Add files via upload #21
Workflow file for this run
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: Generate icns from ico | |
| run: | | |
| mkdir -p build/icons.iconset | |
| sips -z 16 16 assets/icon.ico --out build/icons.iconset/icon_16x16.png 2>/dev/null || true | |
| sips -z 32 32 assets/icon.ico --out build/icons.iconset/icon_16x16@2x.png 2>/dev/null || true | |
| sips -z 32 32 assets/icon.ico --out build/icons.iconset/icon_32x32.png 2>/dev/null || true | |
| sips -z 64 64 assets/icon.ico --out build/icons.iconset/icon_32x32@2x.png 2>/dev/null || true | |
| sips -z 128 128 assets/icon.ico --out build/icons.iconset/icon_128x128.png 2>/dev/null || true | |
| sips -z 256 256 assets/icon.ico --out build/icons.iconset/icon_128x128@2x.png 2>/dev/null || true | |
| sips -z 256 256 assets/icon.ico --out build/icons.iconset/icon_256x256.png 2>/dev/null || true | |
| sips -z 512 512 assets/icon.ico --out build/icons.iconset/icon_256x256@2x.png 2>/dev/null || true | |
| iconutil -c icns build/icons.iconset -o build/icon.icns || true | |
| - 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: Remove ico so electron-builder uses icon.png | |
| run: rm -f assets/icon.ico assets/icon.icns | |
| - 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 |