-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from Garulf/dev
Update workflows
- Loading branch information
Showing
5 changed files
with
138 additions
and
118 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: "PR-Packager" | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
env: | ||
PYTHON_VER: 3.8 | ||
jobs: | ||
deps: | ||
name: "Build" | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python ${{ env.PYTHON_VER }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ env.PYTHON_VER }} | ||
- uses: actions/cache@v2 | ||
if: startsWith(runner.os, 'Windows') | ||
with: | ||
path: ~\AppData\Local\pip\Cache | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install wheel | ||
pip install -r ./requirements.txt -t ./lib | ||
- name: Get Plugin's version | ||
id: version | ||
uses: notiz-dev/github-action-json-property@release | ||
with: | ||
path: 'plugin.json' | ||
prop_path: 'Version' | ||
- name: Package files | ||
run: | | ||
git clone https://github.com/Garulf/flow_commands/ bin | ||
pip install -r ./bin/requirements.txt | ||
python ./bin/commands.py package -n "${{github.event.repository.name}}.zip" | ||
- name: Upload | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: artifact | ||
path: "./${{github.event.repository.name}}.zip" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ on: | |
- .github/workflows/* | ||
- README.md | ||
- assets/* | ||
env: | ||
PYTHON_VER: 3.8 | ||
jobs: | ||
deps: | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
|
@@ -19,44 +21,39 @@ jobs: | |
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python 3.8 | ||
- name: Set up Python ${{ env.PYTHON_VER }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
python-version: ${{ env.PYTHON_VER }} | ||
- uses: actions/cache@v2 | ||
if: startsWith(runner.os, 'Windows') | ||
with: | ||
path: ~\AppData\Local\pip\Cache | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install wheel | ||
pip install -r ./requirements.txt -t ./lib | ||
- name: Determine versioning | ||
- name: Get Plugin's version | ||
id: version | ||
uses: paulhatch/[email protected] | ||
with: | ||
tag_prefix: "v" | ||
major_pattern: "(MAJOR)" | ||
minor_pattern: "(MINOR)" | ||
format: "${major}.${minor}.${patch}" | ||
short_tags: false | ||
bump_each_commit: false | ||
- name: "Update plugin.json version to: ${{steps.version.outputs.prop}}" | ||
uses: jossef/action-set-json-field@v1 | ||
with: | ||
file: 'plugin.json' | ||
field: Version | ||
value: "${{steps.version.outputs.major}}.${{steps.version.outputs.minor}}.${{steps.version.outputs.patch}}" | ||
uses: notiz-dev/github-action-json-property@release | ||
with: | ||
path: 'plugin.json' | ||
prop_path: 'Version' | ||
- name: Package files | ||
run: | | ||
git clone https://github.com/Garulf/flow_commands/ bin | ||
pip install -r ./bin/requirements.txt | ||
python ./bin/commands.py package -n "${{github.event.repository.name}}.zip" | ||
- name: Delete previous drafts | ||
uses: hugo19941994/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Publish | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
draft: true | ||
draft: false | ||
files: "./${{github.event.repository.name}}.zip" | ||
tag_name: "v${{steps.version.outputs.version}}" | ||
tag_name: "v${{steps.version.outputs.prop}}" | ||
generate_release_notes: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: "Test" | ||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
push: | ||
tags-ignore: | ||
- 'v*' | ||
paths-ignore: | ||
- .github/workflows/* | ||
- README.md | ||
- assets/* | ||
env: | ||
PYTHON_VER: 3.8 | ||
jobs: | ||
deps: | ||
name: "Test" | ||
runs-on: windows-latest | ||
steps: | ||
- name: Load Cache | ||
uses: actions/cache@v2 | ||
if: startsWith(runner.os, 'Windows') | ||
with: | ||
path: .\Flow-Launcher-Setup.exe | ||
key: ${{ runner.os }}-flow- | ||
- name: Download Flow Launcher | ||
run: | | ||
if (-Not (Test-Path .\Flow-Launcher-Setup.exe)) | ||
{ | ||
curl.exe -L -o Flow-Launcher-Setup.exe "https://github.com/Flow-Launcher/Flow.Launcher/releases/latest/download/Flow-Launcher-Setup.exe" | ||
} | ||
- name: Install Flow Launcher | ||
run: .\Flow-Launcher-Setup.exe | ||
shell: cmd | ||
- name: Checkout Plugin Repo | ||
uses: actions/checkout@v2 | ||
with: | ||
path: ${{github.event.repository.name}} | ||
- name: Move checkout repo | ||
run: | | ||
$repo_path = Join-Path -Path $pwd -ChildPath ${{github.event.repository.name}} | ||
$plugin_path = Join-Path -Path $env:APPDATA -ChildPath 'FlowLauncher' | Join-Path -ChildPath 'Plugins' | Join-Path -ChildPath ${{github.event.repository.name}} | ||
New-Item -ItemType SymbolicLink -Path $plugin_path -Target $repo_path | ||
echo "PLUGIN_PATH=$plugin_path" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~\AppData\Local\pip\Cache | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install dependencies | ||
run: | | ||
cd ${{ env.PLUGIN_PATH }} | ||
python -m pip install --upgrade pip | ||
pip install wheel | ||
pip install -r ./requirements.txt -t ./lib | ||
- name: Get Plugin's Execute file | ||
id: exe | ||
uses: notiz-dev/github-action-json-property@release | ||
with: | ||
path: '${{ env.PLUGIN_PATH }}/plugin.json' | ||
prop_path: 'ExecuteFileName' | ||
- name: Test Run | ||
run: | | ||
cd ${{ env.PLUGIN_PATH }} | ||
echo ${{ env.PLUGIN_PATH }} | ||
echo ${{steps.exe.outputs.prop}} | ||
python ${{steps.exe.outputs.prop}} |