mirror of
https://github.com/hi2shark/nazhua.git
synced 2026-01-15 16:50:42 +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:
|
with:
|
||||||
node-version: '20' # 根据项目需求调整版本
|
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
|
- name: Install dependencies
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|
||||||
- name: Build project
|
- name: Build project
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
- name: Archive dist folder
|
- name: Get version from package.json
|
||||||
run: |
|
id: get_version
|
||||||
zip -r nazhua-$VERSION.zip dist
|
run: echo "::set-output name=version::$(node -p "require('./package.json').version")"
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
id: create_release
|
id: create_release
|
||||||
@ -39,15 +35,21 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
tag_name: $VERSION
|
tag_name: v${{ steps.get_version.outputs.version }}
|
||||||
release_name: "Release $VERSION"
|
release_name: Release v${{ steps.get_version.outputs.version }}
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: 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
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
asset_path: ./nazhua-$VERSION.zip
|
asset_path: ./build-v${{ steps.get_version.outputs.version }}.zip
|
||||||
asset_name: nazhua-$VERSION.zip
|
asset_name: build-v${{ steps.get_version.outputs.version }}.zip
|
||||||
asset_content_type: application/zip
|
asset_content_type: application/zip
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user