.github/workflows/build.yml #15
This file contains hidden or 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: Build & Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Release tag (e.g. v1.0.3)' | |
| required: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| create-release: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tag: ${{ steps.get-tag.outputs.tag }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Get tag | |
| id: get-tag | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT | |
| else | |
| echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.get-tag.outputs.tag }} | |
| draft: false | |
| generate_release_notes: true | |
| build-mac: | |
| needs: create-release | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ needs.create-release.outputs.tag }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| run: npm install --no-package-lock | |
| - name: Build Mac | |
| run: npx electron-builder --mac --publish never | |
| - name: Upload Mac DMG | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ needs.create-release.outputs.tag }} | |
| files: dist/**/*.dmg | |
| build-linux: | |
| needs: create-release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ needs.create-release.outputs.tag }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install Linux build deps | |
| run: sudo apt-get install -y rpm fakeroot | |
| - name: Install dependencies | |
| run: npm install --no-package-lock | |
| - name: Build Linux | |
| run: npx electron-builder --linux --publish never | |
| - name: Upload Linux AppImage | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ needs.create-release.outputs.tag }} | |
| files: dist/**/*.AppImage |