From 267a4ac6a09f717f7081021130c1fa69ecec25fe Mon Sep 17 00:00:00 2001 From: Lqxc <55340837+lovebaihezi@users.noreply.github.com> Date: Fri, 11 Oct 2024 09:17:27 -0400 Subject: [PATCH] fixup: check if current ref is tag (#31) --- .github/workflows/build.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e99b26..a11cbec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -100,14 +100,14 @@ jobs: run: | zip --recurse-paths ../${{ env.binary }}.zip . - name: Upload binaries to artifacts - if: ${{ github.event_name == 'push' && github.ref == 'refs/tags/*' }} + if: startsWith(github.ref, 'refs/tags/') uses: actions/upload-artifact@v4 with: path: ${{ env.binary }}.zip name: linux retention-days: 1 - name: Upload binaries to release - if: ${{ github.event_name == 'push' && github.ref == 'refs/tags/*' }} + if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v2 with: files: ${{ env.binary }}.zip @@ -142,14 +142,14 @@ jobs: run: | Compress-Archive -Path windows/* -DestinationPath ${{ env.binary }}.zip - name: Upload binaries to artifacts - if: ${{ github.event_name == 'push' && github.ref == 'refs/tags/*' }} + if: startsWith(github.ref, 'refs/tags/') uses: actions/upload-artifact@v4 with: path: ${{ env.binary }}.zip name: windows retention-days: 1 - name: Upload binaries to release - if: ${{ github.event_name == 'push' && github.ref == 'refs/tags/*' }} + if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v2 with: files: ${{ env.binary }}.zip @@ -189,14 +189,14 @@ jobs: cp -r assets ${{ env.binary }}.app/Contents/MacOS/ || true # Try to copy, but ignore if it can't copy if source directory does not exist hdiutil create -fs HFS+ -volname "${{ env.binary }}" -srcfolder ${{ env.binary }}.app ${{ env.binary }}-macOS-intel.dmg - name: Upload binaries to artifacts - if: ${{ github.event_name == 'push' && github.ref == 'refs/tags/*' }} + if: startsWith(github.ref, 'refs/tags/') uses: actions/upload-artifact@v4 with: path: ${{ env.binary }}-macOS-intel.dmg name: macOS-intel retention-days: 1 - name: Upload binaries to release - if: ${{ github.event_name == 'push' && github.ref == 'refs/tags/*' }} + if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v2 with: files: ${{ env.binary }}-macOS-intel.dmg @@ -233,7 +233,7 @@ jobs: hdiutil create -fs HFS+ -volname "${{ env.binary }}-macOS-apple-silicon" -srcfolder ${{ env.binary }}.app ${{ env.binary }}-macOS-apple-silicon.dmg - name: Upload binaries to artifacts - if: ${{ github.event_name == 'push' && github.ref == 'refs/tags/*' }} + if: startsWith(github.ref, 'refs/tags/') uses: actions/upload-artifact@v4 with: path: ${{ env.binary }}-macOS-apple-silicon.dmg @@ -241,7 +241,7 @@ jobs: retention-days: 1 - name: Upload binaries to release - if: ${{ github.event_name == 'push' && github.ref == 'refs/tags/*' }} + if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v2 with: files: ${{ env.binary }}-macOS-apple-silicon.dmg