From 2b9fa92abf591a8e44e7b79b3ce43e33eb344d3b Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Tue, 15 Aug 2023 20:45:48 +1000 Subject: [PATCH] add --- .github/workflows/publish_plugins.yml | 63 +++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/.github/workflows/publish_plugins.yml b/.github/workflows/publish_plugins.yml index e69de29bb2d..d54fdd64f4c 100644 --- a/.github/workflows/publish_plugins.yml +++ b/.github/workflows/publish_plugins.yml @@ -0,0 +1,63 @@ +name: Publish Plugins + +on: + workflow_dispatch: + push: + branches: ['deploy_plugins'] #<-------- + paths: ['Plugins/Flow.Launcher.Plugin.BrowserBookmark/**'] + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + + # - name: Fetch latest release version + # id: fetch-latest-release + # uses: reloc8/action-latest-release-version@1.0.0 + + - 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@v1 + with: + dotnet-version: 7.0.x + + - name: Build + run: | + dotnet publish 'Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj' --framework net7.0-windows -c Release -o "Flow.Launcher.Plugin.BrowserBookmark" + 7z a -tzip "Flow.Launcher.Plugin.BrowserBookmark.zip" "./Flow.Launcher.Plugin.BrowserBookmark/*" + rm -r "Flow.Launcher.Plugin.BrowserBookmark" + + # - name: Upload artifact + # uses: actions/upload-artifact@v2 + # with: + # name: Wox.Plugin.GoogleSearch.zip + # path: . + + - name: Publish + uses: softprops/action-gh-release@v1 + # if: steps.publish-release.outputs.required == 'true' + with: + repository: "Flow-Launcher/Flow.Launcher.Plugin.BrowserBookmark" + files: "Flow.Launcher.Plugin.BrowserBookmark.zip" + tag_name: "v${{steps.updated-version.outputs.prop}}" + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file