-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (61 loc) · 1.89 KB
/
build.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
61
name: Build
on:
push:
branches:
- master
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith( github.event.head_commit.message, 'VER' )
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js 16
uses: actions/[email protected]
with:
node-version: '16'
- name: Install dependencies
run: npm install
- name: Init git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git fetch origin --tags
- name: Build
run: |
npm run build
cp ./dist/* .
mkdir ../res
cp ./dist/* ../res
- name: Commit & Tag
run: |
git add LuoguExtendFeed.min.user.js
git add version
sudo chmod +x ./script/tag.py
export VER=$(./script/tag.py)
git commit -m "Build: $VER"
git tag $VER
echo "VER=$VER" >> $GITHUB_ENV
- name: Push
run: git push origin master:latest --tags -f
- name: Generate release note
run: |
echo "### 更新日志 | Update log" > release-note.txt
cat ./src/changelog.txt >> release-note.txt
- name: Release
uses: softprops/action-gh-release@v1
with:
name: Version ${{ env.VER }}
tag_name: ${{ env.VER }}
body_path: ./release-note.txt
files: ./dist/LuoguExtendFeed.min.user.js
- name: Page
run: cp ./src/changelog.txt -r ./dist
- name: Page deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist
git-config-name: github-actions[bot]
git-config-email: 41898282+github-actions[bot]@users.noreply.github.com