Release #2
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
| # ByteBox - Release Build Workflow | |
| # Made with ❤️ by Pink Pixel | |
| # | |
| # Triggers on any tag that looks like a version: v2.4.0, v3.0.0-beta.1, etc. | |
| # Can also be triggered manually via workflow_dispatch. | |
| # | |
| # Produces: | |
| # • Windows → NSIS installer (.exe) — built on windows-latest | |
| # | |
| # Linux builds (AppImage + .deb) are built locally and uploaded manually. | |
| # | |
| # Create a release like this to trigger it: | |
| # git tag v2.4.0 && git push origin v2.4.0 | |
| # (then create the Release on GitHub, or use the gh CLI) | |
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Release tag to upload to (e.g. v2.4.0)" | |
| required: true | |
| permissions: | |
| contents: write # needed to upload release assets | |
| jobs: | |
| # ── Windows installer (.exe) ──────────────────────────────────────────────── | |
| build-windows: | |
| name: Windows installer | |
| runs-on: windows-latest | |
| # Use bash for all run steps — the npm scripts in package.json use | |
| # Unix pipes (grep) that break under cmd.exe / PowerShell. | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Generate Prisma client | |
| env: | |
| DATABASE_URL: "file:./dev.db" | |
| run: npx prisma generate | |
| # Run next build directly instead of `npm run build` — the npm script | |
| # pipes through `grep` which can fail on Windows even under bash. | |
| # The env vars below replicate what scripts/next-with-env.cjs sets. | |
| - name: Build Next.js | |
| env: | |
| DATABASE_URL: "file:./dev.db" | |
| NEXT_TELEMETRY_DISABLED: "1" | |
| NODE_ENV: production | |
| PORT: "1334" | |
| BROWSERSLIST_IGNORE_OLD_DATA: "1" | |
| BASELINE_BROWSER_MAPPING_IGNORE_OLD_DATA: "1" | |
| run: npx next build | |
| - name: Compile Electron main process | |
| run: npm run electron:compile | |
| - name: Package Windows installer | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: npx electron-builder --win --publish never | |
| - name: Upload to GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref_name }} | |
| files: release/**/*.exe | |
| fail_on_unmatched_files: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |