ci: update publish #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
publish: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest] | |
steps: | |
- name: Checkout git repo | |
uses: actions/checkout@v4 | |
- name: Install Node and NPM | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: npm | |
- name: Install and build | |
run: | | |
npm install | |
npm run postinstall | |
npm run build | |
- name: Publish releases | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
# Only build for the current OS | |
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then | |
npm exec electron-builder -- --publish always --win | |
elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then | |
npm exec electron-builder -- --publish always --linux | |
fi |