From 0cb79a8142d748c2cc56c10262b49a8d81b7e262 Mon Sep 17 00:00:00 2001 From: JupiterPi Date: Thu, 19 Dec 2024 21:42:15 +0100 Subject: [PATCH] workflow: make final steps not fail when files don't exist --- .github/workflows/build-and-publish.yml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index fb65ae1..85946a1 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -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 }}-*