| Marc Kupietz | 5138267 | 2026-03-07 10:31:39 +0100 | [diff] [blame] | 1 | name: Build and Release |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | tags: |
| 6 | - 'v*' |
| 7 | workflow_dispatch: |
| 8 | |
| 9 | jobs: |
| 10 | test: |
| 11 | runs-on: ubuntu-latest |
| 12 | steps: |
| 13 | - uses: actions/checkout@v4 |
| 14 | - uses: actions/setup-node@v4 |
| 15 | with: |
| Marc Kupietz | ebf770e | 2026-03-07 10:56:32 +0100 | [diff] [blame^] | 16 | node-version: '22' |
| Marc Kupietz | 5138267 | 2026-03-07 10:31:39 +0100 | [diff] [blame] | 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: |
| Marc Kupietz | ebf770e | 2026-03-07 10:56:32 +0100 | [diff] [blame^] | 28 | node-version: '22' |
| Marc Kupietz | 5138267 | 2026-03-07 10:31:39 +0100 | [diff] [blame] | 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: |
| 41 | name: conllu-gender-linux-x64 |
| 42 | path: bin/linux/conllu-gender |
| 43 | if-no-files-found: error |
| 44 | - name: Upload macOS binary |
| 45 | uses: actions/upload-artifact@v4 |
| 46 | with: |
| 47 | name: conllu-gender-macos-x64 |
| 48 | path: bin/macos/conllu-gender |
| 49 | if-no-files-found: error |
| 50 | - name: Upload Windows binary |
| 51 | uses: actions/upload-artifact@v4 |
| 52 | with: |
| 53 | name: conllu-gender-win-x64 |
| 54 | path: bin/win/conllu-gender.exe |
| 55 | 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: | |
| 61 | bin/linux/conllu-gender |
| 62 | bin/macos/conllu-gender |
| 63 | bin/win/conllu-gender.exe |
| 64 | generate_release_notes: true |