-
Notifications
You must be signed in to change notification settings - Fork 6
53 lines (45 loc) · 1.32 KB
/
release.yml
File metadata and controls
53 lines (45 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Release Workflow
on:
workflow_dispatch:
inputs:
version:
description: '版本号'
required: true
default: '1.0.0'
changelog:
description: '更新日志'
required: true
default: 'Initial release'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: npm install
- name: Build project
run: npm run build
- name: Create Git Tag
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
TAG_NAME="v${{ github.event.inputs.version }}"
echo "Creating tag: $TAG_NAME"
git tag $TAG_NAME
git push origin $TAG_NAME
- name: Create GitHub Release
uses: softprops/action-gh-release@v2.0.8
with:
tag_name: "v${{ github.event.inputs.version }}"
name: "Release v${{ github.event.inputs.version }}"
body: ${{ github.event.inputs.changelog }}
files: dist/*