-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (59 loc) · 1.91 KB
/
release.yml
File metadata and controls
71 lines (59 loc) · 1.91 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
62
63
64
65
66
67
68
69
70
71
name: Release
on:
push:
tags:
- '*-v[0-9]*'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Extract app name from tag
id: meta
run: |
TAG="${{ github.ref_name }}"
APP="${TAG%-v*}"
echo "app=$APP" >> $GITHUB_OUTPUT
echo "zip=spicetify-${APP}.release.zip" >> $GITHUB_OUTPUT
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- name: Typecheck & lint
run: pnpm typecheck && pnpm lint
- name: Build ${{ steps.meta.outputs.app }}
run: pnpm build:app ${{ steps.meta.outputs.app }}
- name: Package release zip
run: |
APP="${{ steps.meta.outputs.app }}"
mkdir -p release/$APP
cp apps/$APP/dist/index.js release/$APP/
cp apps/$APP/dist/manifest.json release/$APP/
if [ -f apps/$APP/dist/style.css ]; then
cp apps/$APP/dist/style.css release/$APP/
fi
cd release
zip -r ../${{ steps.meta.outputs.zip }} $APP/
- name: Extract changelog entry
id: changelog
run: |
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#*-v}"
CHANGELOG="apps/${{ steps.meta.outputs.app }}/CHANGELOG.md"
[ -f "$CHANGELOG" ] || { echo "body=" >> $GITHUB_OUTPUT; exit 0; }
{
echo "body<<EOF"
awk -v ver="$VERSION" '/^## /{if(found)exit;if($0~ver){found=1;next}}found' "$CHANGELOG"
echo "EOF"
} >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: ${{ steps.meta.outputs.zip }}
body: ${{ steps.changelog.outputs.body }}