-
Notifications
You must be signed in to change notification settings - Fork 7
60 lines (54 loc) · 1.65 KB
/
main-release.yml
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
54
55
56
57
58
59
60
name: main-release
on:
push:
tags:
- "v*.*.*"
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
# environment
- name: checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: install node and pnpm
uses: pnpm/action-setup@v4
with:
version: 8
# prepare
- run: pnpm install
- run: pnpm run lint
- run: pnpm run format
# build normal and minify version, save to folder
- name: build minify
run: pnpm run build:minify
- name: mkdir
run: mkdir build-release
- name: move and rename file
run: mv dist/bilibili-cleaner.user.js build-release/bilibili-cleaner.min.user.js
- name: build default
run: pnpm run build
- name: copy file
run: cp dist/bilibili-cleaner.user.js build-release/
- name: list files
run: ls -lah build-release/
# release
- name: get version num
id: get_vernum
run: |
version=${{ github.ref_name }}
vernum=$( echo $version | sed 's/[^0-9]//g')
echo "New version: $vernum"
echo "VERSION_NUM=$vernum" >> "$GITHUB_OUTPUT"
- name: release action
uses: ncipollo/release-action@v1
with:
artifacts: 'build-release/*.js'
allowUpdates: true
replacesArtifacts: true
generateReleaseNotes: true
body: '## [更新日志](https://github.com/festoney8/bilibili-cleaner/blob/main/CHANGELOG.md#${{ steps.get_vernum.outputs.VERSION_NUM }})'
token: ${{ secrets.GITHUB_TOKEN }}