mirror of
https://github.com/142vip/408CSFamily.git
synced 2026-04-08 21:19:09 +08:00
chore(version): update ci (#40)
* style: test * style: 忽略node_modules * style: 新增read权限测试 --------- Co-authored-by: chu fan <fairy_408@2925.com>
This commit is contained in:
70
.github/workflows/github-version-release.yml
vendored
Normal file
70
.github/workflows/github-version-release.yml
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
name: Github-Version-Release
|
||||
|
||||
on:
|
||||
## 当以 'v' 开头的标签推送到master时触发工作流程
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == '142vip/408CSFamily'
|
||||
|
||||
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 . \
|
||||
-x "node_modules/*"
|
||||
|
||||
# 提取版本号
|
||||
- name: Extract Version
|
||||
id: extract_version
|
||||
run: echo "::set-output name=version::$(node -p "require('./package.json').version")"
|
||||
|
||||
|
||||
# 创建发布版本
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@latest
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: v${{ steps.extract_version.outputs.version }}
|
||||
release_name: Release v${{ steps.extract_version.outputs.version }}
|
||||
body: |
|
||||
|
||||
### Features
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
## 更新资源
|
||||
- name: Upload Assets
|
||||
uses: actions/upload-release-asset@latest
|
||||
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