blob: ba0bd502eecf38a5a80d7e7d412f973e90c50756 [file] [log] [blame]
Marc Kupietzd1531de2026-03-21 14:35:32 +01001name: Build and Release
2
3on:
4 push:
5 tags:
6 - 'v*'
7 workflow_dispatch:
8
9jobs:
10 test:
11 runs-on: ubuntu-latest
12 steps:
13 - uses: actions/checkout@v4
14 - uses: actions/setup-node@v4
15 with:
16 node-version: '22'
17 cache: 'npm'
18 - run: npm ci
19 - run: npm test
20
21 build:
22 needs: test
23 runs-on: ubuntu-latest
24 steps:
25 - uses: actions/checkout@v4
26 - uses: actions/setup-node@v4
27 with:
28 node-version: '22'
29 cache: 'npm'
30 - run: npm ci
31 - run: mkdir -p bin/linux bin/macos bin/win
32 - name: Build Linux executable
33 run: npm run pkg-linux
34 - name: Build macOS executable
35 run: npm run pkg-macos
36 - name: Build Windows executable
37 run: npm run pkg-win
38 - name: Upload Linux binary
39 uses: actions/upload-artifact@v4
40 with:
Marc Kupietz202a36d2026-04-12 14:58:13 +020041 name: cmc-tagger-linux-x64
42 path: bin/linux/cmc-tagger
Marc Kupietzd1531de2026-03-21 14:35:32 +010043 if-no-files-found: error
44 - name: Upload macOS binary
45 uses: actions/upload-artifact@v4
46 with:
Marc Kupietz202a36d2026-04-12 14:58:13 +020047 name: cmc-tagger-macos-x64
48 path: bin/macos/cmc-tagger
Marc Kupietzd1531de2026-03-21 14:35:32 +010049 if-no-files-found: error
50 - name: Upload Windows binary
51 uses: actions/upload-artifact@v4
52 with:
Marc Kupietz202a36d2026-04-12 14:58:13 +020053 name: cmc-tagger-win-x64
54 path: bin/win/cmc-tagger.exe
Marc Kupietzd1531de2026-03-21 14:35:32 +010055 if-no-files-found: error
56 - name: Create GitHub Release
57 if: startsWith(github.ref, 'refs/tags/')
58 uses: softprops/action-gh-release@v2
59 with:
60 files: |
Marc Kupietz202a36d2026-04-12 14:58:13 +020061 bin/linux/cmc-tagger
62 bin/macos/cmc-tagger
63 bin/win/cmc-tagger.exe
Marc Kupietzd1531de2026-03-21 14:35:32 +010064 generate_release_notes: true