-
Notifications
You must be signed in to change notification settings - Fork 2
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 #4 from HorridModz/HorridModz-patch-1
Add Github Actions workflow and change version to `2.0.1`
- Loading branch information
Showing
3 changed files
with
95 additions
and
1 deletion.
There are no files selected for viewing
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,34 @@ | ||
name: Build Pull Request | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- .github/workflows/* | ||
- .gitignore | ||
- idea/* | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 7.0.x | ||
- name: get version | ||
id: version | ||
uses: notiz-dev/github-action-json-property@release | ||
with: | ||
path: 'plugin.json' | ||
prop_path: 'Version' | ||
- run: echo ${{steps.version.outputs.prop}} | ||
- name: Build | ||
run: | | ||
dotnet publish 'Flow.Launcher.Plugin.Add2Path.csproj' -c Release -r win-x64 --no-self-contained -o "Add2Path-${{steps.version.outputs.prop}}" | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: 'Add2Path-${{steps.version.outputs.prop}}' | ||
path: 'Add2Path-${{steps.version.outputs.prop}}' |
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,60 @@ | ||
name: Publish Release | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
paths-ignore: | ||
- .github/workflows/* | ||
- .gitignore | ||
- idea/* | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Fetch latest release version | ||
id: fetch-latest-release | ||
uses: reloc8/[email protected] | ||
- name: Get updated version | ||
id: updated-version | ||
uses: notiz-dev/github-action-json-property@release | ||
with: | ||
path: 'plugin.json' | ||
prop_path: 'Version' | ||
- name: Determine if publish release required | ||
id: publish-release | ||
run: | | ||
$updated_ver="${{steps.updated-version.outputs.prop}}" | ||
$release_ver="${{ steps.fetch-latest-release.outputs.latest-release }}".replace('v','') | ||
if ($updated_ver -ne $release_ver -and "${{github.ref_name}}" -eq 'master') { | ||
echo "::set-output name=required::true" | ||
} | ||
echo "Updated version is $updated_ver" | ||
echo "Release version is $release_ver" | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 7.0.x | ||
- name: Get version | ||
id: version | ||
uses: notiz-dev/github-action-json-property@release | ||
with: | ||
path: 'plugin.json' | ||
prop_path: 'Version' | ||
- run: echo ${{steps.version.outputs.prop}} | ||
- name: Build | ||
run: | | ||
dotnet publish 'Flow.Launcher.Plugin.Add2Path.csproj' -r win-x64 -c Release -o "Flow.Launcher.Plugin.Add2Path" | ||
7z a -tzip "Add2Path-${{steps.version.outputs.prop}}.zip" "./Flow.Launcher.Plugin.Add2Path/*" | ||
- name: Publish | ||
uses: softprops/action-gh-release@v1 | ||
if: steps.publish-release.outputs.required == 'true' | ||
with: | ||
files: "Add2Path-${{steps.version.outputs.prop}}.zip" | ||
tag_name: "v${{steps.version.outputs.prop}}" | ||
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