Skip to content

Commit ad354e0

Browse files
committed
fix: correct artifact name output in build workflow and update zip filename format in release workflow
1 parent 7ceb12a commit ad354e0

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
runs-on: ubuntu-latest
2727
outputs:
2828
version: ${{ steps.build.outputs.version }}
29-
artifact_name: ${{ steps.build.outputs.name }}
29+
artifact_name: ${{ steps.build.outputs.artifact_name }}
3030
artifact_url: ${{ steps.artifacts.outputs.artifact-url }}
3131
artifact_id: ${{ steps.artifacts.outputs.artifact-id }}
3232
steps:
@@ -51,8 +51,12 @@ jobs:
5151
npm install && npm run bundle
5252
5353
name=$(jq -r .name package.json)
54+
version=$(jq -r .version package.json)
55+
artifact_name="${name}.${version}"
56+
5457
echo "name=$name" >> $GITHUB_OUTPUT
55-
echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
58+
echo "version=$version" >> $GITHUB_OUTPUT
59+
echo "artifact_name=$artifact_name" >> $GITHUB_OUTPUT
5660
5761
mkdir -p ./upload/$name
5862
mv ./bundle/* ./upload/$name/ 2>/dev/null || true
@@ -61,5 +65,5 @@ jobs:
6165
id: artifacts
6266
uses: actions/upload-artifact@v4
6367
with:
64-
name: ${{ steps.build.outputs.name }}
68+
name: ${{ steps.build.outputs.artifact_name }}
6569
path: ./upload

.github/workflows/release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ jobs:
3232
- name: Create zip archive
3333
id: zip
3434
run: |
35-
# zip filename format: <artifact_name>.<tag_name>.zip
36-
zip_name="${{ needs.build.outputs.artifact_name }}.${{ github.event.release.tag_name }}.zip"
35+
# zip filename format: <artifact_name>.zip
36+
zip_name="${{ needs.build.outputs.artifact_name }}.zip"
3737
3838
cd ./bundle/${{ needs.build.outputs.artifact_name }}
3939
zip -r "../$zip_name" .
@@ -89,4 +89,3 @@ jobs:
8989
echo "::notice::Monitor workflow progress at: $run_url"
9090
echo "workflow_url=$run_url" >> $GITHUB_OUTPUT
9191
fi
92-

0 commit comments

Comments
 (0)