-
Notifications
You must be signed in to change notification settings - Fork 25
98 lines (82 loc) · 3.06 KB
/
Release-Dev-Auto.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Release-Dev-Auto
on:
push:
branches: master
jobs:
release-dev-auto:
runs-on: ubuntu-latest
environment: production
name: Build & release dev version
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Determine bump type
uses: zwaldowski/match-label-action@v5
id: bump
with:
allowed: premajor,preminor,prepatch
default_match: prerelease
- name: Get new version
uses: zwaldowski/semver-release-action@v4
id: semver
with:
bump: ${{ steps.bump.outputs.match }}
github_token: ${{ secrets.GITHUB_TOKEN }}
dry_run: true
preid: 'dev'
- name: Update version in package.json
run: pnpm version ${{ steps.semver.outputs.version_tag }} --no-git-tag-version
- name: Build
run: pnpm build
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- name: Create changelog
run: |
git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"* %B" > changelog.txt
echo 'CHANGELOG<<CHANGELOG_END' >> $GITHUB_ENV
cat changelog.txt >> $GITHUB_ENV
echo -e '\nCHANGELOG_END' >> $GITHUB_ENV
- name: Create build.zip
run: zip -r ../build/Shoko-WebUI-v${{ steps.semver.outputs.version_tag }}.zip ./* -x "**/*.js.map"
working-directory: ./dist
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: ./build/Shoko-WebUI-v${{ steps.semver.outputs.version_tag }}.zip
tag_name: v${{ steps.semver.outputs.version_tag }}
prerelease: true
fail_on_unmatched_files: true
body_path: ./changelog.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get current datetime
id: date
run: echo "date=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_OUTPUT
- name: Notify discord
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK }}
embed-color: 7641851
embed-timestamp: ${{ steps.date.outputs.date }}
embed-author-name: Web UI | New Daily Build
embed-author-icon-url: https://raw.githubusercontent.com/${{ github.repository }}/master/.github/images/webui.png
embed-author-url: https://github.com/${{ github.repository }}
embed-description: |
**Version**: `${{ steps.semver.outputs.version_tag }}`
Update from the Web UI or click [here](https://github.com/${{ github.repository }}/releases/tag/v${{ steps.semver.outputs.version_tag }}) to download!
**Changes since last build**:
${{ env.CHANGELOG }}