-
-
Notifications
You must be signed in to change notification settings - Fork 17
96 lines (82 loc) · 2.87 KB
/
Copy pathrelease.yml
File metadata and controls
96 lines (82 loc) · 2.87 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Build Release
on:
workflow_dispatch:
inputs:
version_tag:
description: 'Version label for the build (e.g. alpha-1, beta-2)'
required: false
default: ''
permissions:
contents: read
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
dist_cmd: dist:linux
- os: macos-latest
dist_cmd: dist:mac
# Pin Windows to VS 2022; windows-latest can roll to VS 2026 before
# Electron's node-gyp stack recognizes the new Visual Studio version.
- os: windows-2022
dist_cmd: dist:win
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22.x
cache: 'npm'
- name: Cache Electron
uses: actions/cache@v5
with:
path: |
~/.cache/electron
~/.cache/electron-builder
key: ${{ runner.os }}-electron-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-electron-
- name: Install dependencies
run: npm ci
- name: Install Linux native build tools
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y build-essential python3 libasound2-dev
- name: Build native DSP module
run: npm run rebuild:native
- name: Verify native module exists
shell: bash
run: |
if [ ! -f native/build/Release/visualizer_dsp.node ]; then
echo "ERROR: native DSP module was not built!"
exit 1
fi
echo "Native module built successfully: $(ls -lh native/build/Release/visualizer_dsp.node)"
- name: Write Last.fm credentials file
shell: bash
env:
LASTFM_API_KEY: ${{ secrets.LASTFM_API_KEY }}
LASTFM_SHARED_SECRET: ${{ secrets.LASTFM_SHARED_SECRET }}
run: |
node -e 'const fs=require("fs"); const key=process.env.LASTFM_API_KEY ?? ""; const secret=process.env.LASTFM_SHARED_SECRET ?? ""; fs.writeFileSync(".env.local", `LASTFM_API_KEY=${key}\nLASTFM_SHARED_SECRET=${secret}\n`, "utf8")'
- name: Build distributable
run: npm run ${{ matrix.dist_cmd }}
- name: Verify release artifact names
run: node scripts/release/verify-release-artifacts.cjs
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: astra-${{ runner.os }}${{ inputs.version_tag && format('-{0}', inputs.version_tag) || '' }}
path: |
dist/*.exe
dist/*.dmg
dist/*.zip
dist/*.AppImage
dist/*.deb
dist/*.rpm
dist/*.tar.gz
if-no-files-found: error
retention-days: 30