From 4d9643dcb2f06f077e8be4d284509da9eac74a62 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sat, 27 Sep 2025 17:20:45 +0800 Subject: [PATCH] raise an error if the file does not exist when uploading an artifact --- .github/workflows/build-release.yml | 5 +++-- .github/workflows/build-snapshot.yml | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index c9d575eb..8b27c85d 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -122,7 +122,7 @@ jobs: - name: Extract frontend files from linux-amd64 package run: | New-Item -ItemType Directory -Path package - tar -xzf (Get-ChildItem artifacts\ezbookkeeping-v*-linux-amd64.tar.gz) -C package + tar -xzf (Get-ChildItem artifacts\ezbookkeeping-${{ github.ref_name }}-linux-amd64.tar.gz) -C package - name: Set up Go uses: actions/setup-go@v6 @@ -176,7 +176,8 @@ jobs: uses: actions/upload-artifact@v4 with: name: ezbookkeeping-${{ github.ref_name }}-windows-x64 - path: ezbookkeeping-v*-windows-x64.zip + path: ezbookkeeping-${{ github.ref_name }}-windows-x64.zip + if-no-files-found: error publish-release: runs-on: ubuntu-latest diff --git a/.github/workflows/build-snapshot.yml b/.github/workflows/build-snapshot.yml index f4939f75..59765987 100644 --- a/.github/workflows/build-snapshot.yml +++ b/.github/workflows/build-snapshot.yml @@ -121,7 +121,7 @@ jobs: - name: Extract frontend files from linux-amd64 package run: | New-Item -ItemType Directory -Path package - tar -xzf (Get-ChildItem artifacts\ezbookkeeping-dev-*-linux-amd64.tar.gz) -C package + tar -xzf (Get-ChildItem artifacts\ezbookkeeping-dev-${{ github.run_id }}-linux-amd64.tar.gz) -C package - name: Set up Go uses: actions/setup-go@v6 @@ -174,4 +174,5 @@ jobs: uses: actions/upload-artifact@v4 with: name: ezbookkeeping-dev-${{ github.run_id }}-windows-x64 - path: ezbookkeeping-dev-*-windows-x64.zip + path: ezbookkeeping-dev-${{ github.run_id }}-windows-x64.zip + if-no-files-found: error