-
Notifications
You must be signed in to change notification settings - Fork 96
61 lines (52 loc) · 1.67 KB
/
build.yaml
File metadata and controls
61 lines (52 loc) · 1.67 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
54
55
56
57
58
59
60
61
name: Release
on:
pull_request:
types:
- closed
branches:
- master
jobs:
release:
if: github.event.pull_request.merged == true && github.event.pull_request.head.ref == 'dev'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "22.16.0"
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build
- name: Get package version
id: package_version
run: echo "version=$(node -p \"require('./package.json').version\")" >> $GITHUB_OUTPUT
- name: Read changelog for current version
id: changelog
run: |
VERSION="${{ steps.package_version.outputs.version }}"
{
echo "body<<EOF"
awk -v version="$VERSION" '
$0 ~ "^## \\[" version "\\]" {flag=1}
flag && /^## \[/ && $0 !~ "^## \\[" version "\\]" {exit}
flag
' CHANGELOG.md
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.package_version.outputs.version }}
name: v${{ steps.package_version.outputs.version }}
body: ${{ steps.changelog.outputs.body }}
draft: false
prerelease: false
files: |
dist/bilibili-live-tasks-helper.meta.js
dist/bilibili-live-tasks-helper.user.js
dist/bilibili-live-tasks-helper.min.user.js