-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (37 loc) · 1.08 KB
/
release.yml
File metadata and controls
47 lines (37 loc) · 1.08 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
name: Release
on:
push:
tags: ['v*']
jobs:
release:
runs-on: windows-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
- run: npm ci
- name: Build
run: npm run build
- name: Build Windows portable and publish to GitHub Releases
run: npx electron-builder --win --publish always
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish release (undraft)
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ github.ref_name }}
run: gh release edit "$TAG_NAME" --draft=false
- name: Delete old releases (keep latest 3)
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release list --json tagName --jq '.[].tagName' | tail -n +4 | while read -r tag; do
echo "Deleting release $tag"
gh release delete "$tag" --yes --cleanup-tag
done