-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (58 loc) · 1.75 KB
/
release.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
name: Release
on:
release:
types: [created]
jobs:
publish-npm:
runs-on: ubuntu-latest
name: "Publish package to npm registry"
steps:
- uses: actions/checkout@v4
name: "Checkout repo"
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org/
name: "Install Node.js"
- run: npm ci
name: "Install dependencies"
- run: npm test
name: "Run tests"
- run: npm run build
name: "Build distribution bundle"
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
name: "Publish to registry"
build-executables:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
name: Build executables on ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
name: Checkout repo
- uses: actions/setup-node@v4
with:
node-version: 22
name: Install Node.js
- run: npm ci
name: Install dependencies
- run: npm run build:sea
name: Build executables
- run: |
EXT=""
if [ "${{ matrix.os }}" == "windows-latest" ]; then
EXT=".exe"
fi
mv build/sea/app${EXT} build/sea/${{ github.event.repository.name }}-${{ github.ref_name }}-${{ runner.arch }}${EXT}
shell: bash
name: Rename executable
- uses: softprops/action-gh-release@v1
with:
files: |
build/sea/${{ github.event.repository.name }}-${{ github.ref_name }}-${{ runner.arch }}${{ matrix.os == 'windows-latest' && '.exe' || '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: Attach executables to release