Skip to content

Commit 272ad99

Browse files
committed
ci(github_release): extract version without v prefix for asset paths
Update the release workflow to extract the version number without the 'v' prefix and use it consistently in asset paths and names. This ensures consistency in the naming convention across the release artifacts.
1 parent cc25587 commit 272ad99

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/github_release.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,20 @@ jobs:
4444
run: |
4545
npm install -g @mapbox/node-pre-gyp
4646
npx @mapbox/node-pre-gyp package
47-
- name: Get Node ABI
47+
- name: Get Node ABI and Version without v prefix
4848
id: node_abi
4949
run: |
5050
NODE_ABI=$(node -e "console.log('node-v' + process.versions.modules)")
5151
echo "abi=$NODE_ABI" >> $GITHUB_OUTPUT
52+
VERSION=${GITHUB_REF_NAME#v}
53+
echo "version=$VERSION" >> $GITHUB_OUTPUT
5254
5355
- name: Upload Binary
5456
uses: actions/upload-release-asset@v1
5557
env:
5658
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5759
with:
5860
upload_url: ${{ needs.create_release.outputs.upload_url }}
59-
asset_path: ./build/stage/v${{ github.ref_name }}/${{ runner.os == 'Linux' && 'linux' || runner.os == 'Windows' && 'win32' || 'darwin' }}-unknown/nodejieba-v${{ github.ref_name }}-${{ steps.node_abi.outputs.abi }}-${{ runner.os == 'Linux' && 'linux' || runner.os == 'Windows' && 'win32' || 'darwin' }}-${{ runner.arch }}-unknown.tar.gz
60-
asset_name: nodejieba-v${{ github.ref_name }}-${{ steps.node_abi.outputs.abi }}-${{ runner.os == 'Linux' && 'linux' || runner.os == 'Windows' && 'win32' || 'darwin' }}-${{ runner.arch }}-unknown.tar.gz
61+
asset_path: ./build/stage/v${{ steps.node_abi.outputs.version }}/${{ runner.os == 'Linux' && 'linux' || runner.os == 'Windows' && 'win32' || 'darwin' }}-unknown/nodejieba-v${{ steps.node_abi.outputs.version }}-${{ steps.node_abi.outputs.abi }}-${{ runner.os == 'Linux' && 'linux' || runner.os == 'Windows' && 'win32' || 'darwin' }}-${{ runner.arch }}-unknown.tar.gz
62+
asset_name: nodejieba-v${{ steps.node_abi.outputs.version }}-${{ steps.node_abi.outputs.abi }}-${{ runner.os == 'Linux' && 'linux' || runner.os == 'Windows' && 'win32' || 'darwin' }}-${{ runner.arch }}-unknown.tar.gz
6163
asset_content_type: application/gzip

0 commit comments

Comments
 (0)