mirror of
https://github.com/hi2shark/nazhua.git
synced 2026-01-14 16:20:44 +08:00
Update release.yml
This commit is contained in:
parent
4a9fcd9906
commit
fab7b58d14
26
.github/workflows/release.yml
vendored
26
.github/workflows/release.yml
vendored
@ -19,19 +19,15 @@ jobs:
|
||||
with:
|
||||
node-version: '20' # 根据项目需求调整版本
|
||||
|
||||
- name: Get version from package.json
|
||||
id: get_version
|
||||
run: echo "VERSION=$(node -p 'require("./package.json").version')" >> $GITHUB_ENV
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Build project
|
||||
run: npm run build
|
||||
|
||||
- name: Archive dist folder
|
||||
run: |
|
||||
zip -r nazhua-$VERSION.zip dist
|
||||
- name: Get version from package.json
|
||||
id: get_version
|
||||
run: echo "::set-output name=version::$(node -p "require('./package.json').version")"
|
||||
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
@ -39,15 +35,21 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: $VERSION
|
||||
release_name: "Release $VERSION"
|
||||
tag_name: v${{ steps.get_version.outputs.version }}
|
||||
release_name: Release v${{ steps.get_version.outputs.version }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
||||
- name: Upload release to GitHub
|
||||
- name: Package build output
|
||||
run: |
|
||||
zip -r build-v${{ steps.get_version.outputs.version }}.zip dist
|
||||
|
||||
- name: Upload Release Asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./nazhua-$VERSION.zip
|
||||
asset_name: nazhua-$VERSION.zip
|
||||
asset_path: ./build-v${{ steps.get_version.outputs.version }}.zip
|
||||
asset_name: build-v${{ steps.get_version.outputs.version }}.zip
|
||||
asset_content_type: application/zip
|
||||
|
||||
Loading…
Reference in New Issue
Block a user