| name: Build and Release |
| |
| on: |
| push: |
| tags: |
| - 'v*' |
| workflow_dispatch: |
| |
| jobs: |
| test: |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v4 |
| - uses: actions/setup-node@v4 |
| with: |
| node-version: '22' |
| cache: 'npm' |
| - run: npm ci |
| - run: npm test |
| |
| build: |
| needs: test |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v4 |
| - uses: actions/setup-node@v4 |
| with: |
| node-version: '22' |
| cache: 'npm' |
| - run: npm ci |
| - run: mkdir -p bin/linux bin/macos bin/win |
| - name: Build Linux executable |
| run: npm run pkg-linux |
| - name: Build macOS executable |
| run: npm run pkg-macos |
| - name: Build Windows executable |
| run: npm run pkg-win |
| - name: Upload Linux binary |
| uses: actions/upload-artifact@v4 |
| with: |
| name: conllu-gender-linux-x64 |
| path: bin/linux/conllu-gender |
| if-no-files-found: error |
| - name: Upload macOS binary |
| uses: actions/upload-artifact@v4 |
| with: |
| name: conllu-gender-macos-x64 |
| path: bin/macos/conllu-gender |
| if-no-files-found: error |
| - name: Upload Windows binary |
| uses: actions/upload-artifact@v4 |
| with: |
| name: conllu-gender-win-x64 |
| path: bin/win/conllu-gender.exe |
| if-no-files-found: error |
| - name: Create GitHub Release |
| if: startsWith(github.ref, 'refs/tags/') |
| uses: softprops/action-gh-release@v2 |
| with: |
| files: | |
| bin/linux/conllu-gender |
| bin/macos/conllu-gender |
| bin/win/conllu-gender.exe |
| generate_release_notes: true |