Build & Release #1
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: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Release tag (e.g. v1.1.1-beta)' | |
| required: true | |
| prerelease: | |
| description: 'Mark as pre-release' | |
| type: boolean | |
| default: true | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Download yt-dlp (Linux) | |
| run: | | |
| mkdir -p bin/linux | |
| curl -L -o bin/linux/yt-dlp https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp | |
| chmod +x bin/linux/yt-dlp | |
| - name: Build Linux AppImage | |
| run: npm run build | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload Linux artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-build | |
| path: dist/*.AppImage | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Download yt-dlp (Windows) | |
| run: | | |
| New-Item -ItemType Directory -Force -Path bin\win | |
| Invoke-WebRequest -Uri "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe" -OutFile "bin\win\yt-dlp.exe" | |
| - name: Build Windows installer | |
| run: npm run build:win | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload Windows artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-build | |
| path: dist/*.exe | |
| release: | |
| needs: [build-linux, build-windows] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ inputs.tag }} | |
| name: Snowify ${{ inputs.tag }} | |
| prerelease: ${{ inputs.prerelease }} | |
| generate_release_notes: true | |
| files: | | |
| artifacts/linux-build/* | |
| artifacts/windows-build/* |