forked from LifeArchiveProject/WeChatDataAnalysis
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (65 loc) · 2.04 KB
/
release.yml
File metadata and controls
77 lines (65 loc) · 2.04 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
72
73
74
75
76
77
name: Release (Windows)
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build-windows-installer:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Derive version from tag
shell: pwsh
run: |
$tag = "${{ github.ref_name }}"
$version = $tag -replace '^v', ''
if ([string]::IsNullOrWhiteSpace($version)) {
throw "Invalid tag: '$tag' (expected like v1.0.0)"
}
"TAG_NAME=$tag" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
"VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: |
frontend/package-lock.json
desktop/package-lock.json
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install uv
shell: pwsh
run: |
python -m pip install --upgrade pip
python -m pip install uv
- name: Install frontend deps
working-directory: frontend
run: npm ci
- name: Install desktop deps
working-directory: desktop
run: npm ci
- name: Set desktop app version (electron-builder)
working-directory: desktop
shell: pwsh
run: |
npm version $env:VERSION --no-git-tag-version --allow-same-version
- name: Build Windows installer
working-directory: desktop
run: npm run dist
- name: Create GitHub Release and upload installer
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}
name: ${{ env.TAG_NAME }}
generate_release_notes: true
files: |
desktop/dist/*Setup*.exe
desktop/dist/*Setup*.exe.blockmap