Skip to content

Commit

Permalink
workflow: make final steps not fail when files don't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
JupiterPi committed Dec 19, 2024
1 parent ceea438 commit 0cb79a8
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,14 @@ jobs:
rm -f certificate.p12
- name: Rename artifacts to include release number
run: |
mv dist/filen-cli-win-x64.exe dist/filen-cli-${{ github.event.release.tag_name }}-win-x64.exe
mv dist/filen-cli-win-arm64.exe dist/filen-cli-${{ github.event.release.tag_name }}-win-arm64.exe
mv dist/filen-cli-linux-x64 dist/filen-cli-${{ github.event.release.tag_name }}-linux-x64
mv dist/filen-cli-linux-arm64 dist/filen-cli-${{ github.event.release.tag_name }}-linux-arm64
mv dist/filen-cli-macos-x64 dist/filen-cli-${{ github.event.release.tag_name }}-macos-x64
mv dist/filen-cli-macos-arm64 dist/filen-cli-${{ github.event.release.tag_name }}-macos-arm64
# move files only if they exist
[ ! -f dist/filen-cli-win-x64.exe ] || mv dist/filen-cli-win-x64.exe dist/filen-cli-${{ github.event.release.tag_name }}-win-x64.exe
[ ! -f dist/filen-cli-win-arm64.exe ] || mv dist/filen-cli-win-arm64.exe dist/filen-cli-${{ github.event.release.tag_name }}-win-arm64.exe
[ ! -f dist/filen-cli-linux-x64 ] || mv dist/filen-cli-linux-x64 dist/filen-cli-${{ github.event.release.tag_name }}-linux-x64
[ ! -f dist/filen-cli-linux-arm64 ] || mv dist/filen-cli-linux-arm64 dist/filen-cli-${{ github.event.release.tag_name }}-linux-arm64
[ ! -f dist/filen-cli-macos-x64 ] || mv dist/filen-cli-macos-x64 dist/filen-cli-${{ github.event.release.tag_name }}-macos-x64
[ ! -f dist/filen-cli-macos-arm64 ] || mv dist/filen-cli-macos-arm64 dist/filen-cli-${{ github.event.release.tag_name }}-macos-arm64
- name: Attach artifacts to release
uses: softprops/action-gh-release@v2
with:
files: |
dist/filen-cli-${{ github.event.release.tag_name }}-win-x64.exe
dist/filen-cli-${{ github.event.release.tag_name }}-win-arm64.exe
dist/filen-cli-${{ github.event.release.tag_name }}-linux-x64
dist/filen-cli-${{ github.event.release.tag_name }}-linux-arm64
dist/filen-cli-${{ github.event.release.tag_name }}-macos-x64
dist/filen-cli-${{ github.event.release.tag_name }}-macos-arm64
files: dist/filen-cli-${{ github.event.release.tag_name }}-*

0 comments on commit 0cb79a8

Please sign in to comment.