mirror of
https://github.com/142vip/408CSFamily.git
synced 2026-02-02 18:20:26 +08:00
Merge pull request #37 from mmdapl/feat/add-release-action
ci: add release ci
This commit is contained in:
63
.github/workflows/release.yml
vendored
Normal file
63
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
name: Release New Version
|
||||
|
||||
on:
|
||||
## 当以 'v' 开头的标签推送到master时触发工作流程
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.20.2
|
||||
|
||||
- name: PNPM Install
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 7
|
||||
run_install: true
|
||||
|
||||
### 打成压缩包
|
||||
- name: Create Zip Archive
|
||||
run: |
|
||||
zip -r 408CSFamily.zip .
|
||||
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: Release ${{ github.ref }}
|
||||
body: |
|
||||
Release ${{ github.ref }}
|
||||
- Add feature A
|
||||
- Fix bug B
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
||||
- name: Upload Assets
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./408CSFamily.zip
|
||||
asset_name: 408CSFamily.zip
|
||||
asset_content_type: application/zip
|
||||
Reference in New Issue
Block a user