Skip to content

Commit

Permalink
Merge pull request #4 from HorridModz/HorridModz-patch-1
Browse files Browse the repository at this point in the history
Add Github Actions workflow and change version to `2.0.1`
  • Loading branch information
HorridModz authored Aug 17, 2024
2 parents 31908da + 6069471 commit fb5e522
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .github/workflows/build-action.yml
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}}'
60 changes: 60 additions & 0 deletions .github/workflows/publish-action.yml
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 }}

2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Name": "Add2Path",
"Description": "Manage your PATH environment variable",
"Author": "HorridModz",
"Version": "2.0.0",
"Version": "2.0.1",
"Language": "csharp",
"Website": "https://github.com/HorridModz/Flow.Launcher.Plugin.Add2Path",
"IcoPath": "icon.png",
Expand Down

0 comments on commit fb5e522

Please sign in to comment.