IKHSAN
EN Read in EnglishID

pixies

Publik
Branch
master
Commit terakhir
9b0697f26 Oktober 2026

build-binaries.yml

Buka raw
name: Build Binaries

on:
  workflow_call:
    inputs:
      version:
        required: true
        type: string
      release_id:
        required: true
        type: string

jobs:
  build-windows:
    name: "Windows (x64)"
    runs-on: windows-latest
    steps:
      - name: Checkout project
        uses: actions/checkout@v4

      - name: Setup Bun
        uses: oven-sh/setup-bun@v2
        with:
          bun-version: latest

      - name: Install client dependencies
        working-directory: client
        run: bun install

      - name: Build client
        working-directory: client
        run: bun run build

      - name: Move build folder
        run: Move-Item -Path client/build -Destination .

      - name: Install server dependencies
        run: bun install

      - name: Generate migrations
        run: bun run generate-migrations

      - name: Generate integrations
        run: bun run generate-integrations

      - name: Generate client embed
        run: bun run generate-client-embed

      - name: Compile binary
        run: bun build --compile --compile-autoload-package-json --external pg-hstore --external pg --target=bun-windows-x64 server/index.js --outfile Pixies.exe

      - name: Upload to Release
        uses: actions/github-script@v7
        with:
          script: |
            const fs = require('fs');
            await github.rest.repos.uploadReleaseAsset({
              owner: context.repo.owner,
              repo: context.repo.repo,
              release_id: ${{ inputs.release_id }},
              name: 'Pixies-windows-x64.exe',
              data: fs.readFileSync('Pixies.exe')
            });

      - name: Upload artifact for MSI
        uses: actions/upload-artifact@v4
        with:
          name: Pixies-windows-x64.exe
          path: Pixies.exe

      - name: Upload build folder for MSI
        uses: actions/upload-artifact@v4
        with:
          name: build-folder
          path: build

  build-linux:
    name: "Linux (${{ matrix.arch }})"
    runs-on: ${{ matrix.runner }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - arch: x64
            target: bun-linux-x64
            runner: ubuntu-latest
            artifact_name: Pixies-linux-x64
          - arch: arm64
            target: bun-linux-arm64
            runner: ubuntu-24.04-arm
            artifact_name: Pixies-linux-arm64

    steps:
      - name: Checkout project
        uses: actions/checkout@v4

      - name: Setup Bun
        uses: oven-sh/setup-bun@v2
        with:
          bun-version: latest

      - name: Install client dependencies
        working-directory: client
        run: bun install

      - name: Build client
        working-directory: client
        run: bun run build

      - name: Move build folder
        run: mv client/build .

      - name: Install server dependencies
        run: bun install

      - name: Generate migrations
        run: bun run generate-migrations

      - name: Generate integrations
        run: bun run generate-integrations

      - name: Generate client embed
        run: bun run generate-client-embed

      - name: Compile binary
        run: bun build --compile --compile-autoload-package-json --external pg-hstore --external pg --target=${{ matrix.target }} server/index.js --outfile Pixies

      - name: Rename binary
        run: mv Pixies ${{ matrix.artifact_name }}

      - name: Upload to Release
        uses: actions/github-script@v7
        with:
          script: |
            const fs = require('fs');
            await github.rest.repos.uploadReleaseAsset({
              owner: context.repo.owner,
              repo: context.repo.repo,
              release_id: ${{ inputs.release_id }},
              name: '${{ matrix.artifact_name }}',
              data: fs.readFileSync('${{ matrix.artifact_name }}')
            });

  build-macos:
    name: "macOS (${{ matrix.arch }})"
    runs-on: macos-latest
    strategy:
      fail-fast: false
      matrix:
        include:
          - arch: x64
            target: bun-darwin-x64
            artifact_name: Pixies-macos-x64
          - arch: arm64
            target: bun-darwin-arm64
            artifact_name: Pixies-macos-arm64

    steps:
      - name: Checkout project
        uses: actions/checkout@v4

      - name: Setup Bun
        uses: oven-sh/setup-bun@v2
        with:
          bun-version: latest

      - name: Install client dependencies
        working-directory: client
        run: bun install

      - name: Build client
        working-directory: client
        run: bun run build

      - name: Move build folder
        run: mv client/build .

      - name: Install server dependencies
        run: bun install

      - name: Generate migrations
        run: bun run generate-migrations

      - name: Generate integrations
        run: bun run generate-integrations

      - name: Generate client embed
        run: bun run generate-client-embed

      - name: Compile binary
        run: bun build --compile --compile-autoload-package-json --external pg-hstore --external pg --target=${{ matrix.target }} server/index.js --outfile Pixies

      - name: Rename binary
        run: mv Pixies ${{ matrix.artifact_name }}

      - name: Upload to Release
        uses: actions/github-script@v7
        with:
          script: |
            const fs = require('fs');
            await github.rest.repos.uploadReleaseAsset({
              owner: context.repo.owner,
              repo: context.repo.repo,
              release_id: ${{ inputs.release_id }},
              name: '${{ matrix.artifact_name }}',
              data: fs.readFileSync('${{ matrix.artifact_name }}')
            });

  build-zip:
    name: "Source ZIP"
    runs-on: ubuntu-latest
    steps:
      - name: Checkout project
        uses: actions/checkout@v4

      - name: Setup Bun
        uses: oven-sh/setup-bun@v2
        with:
          bun-version: latest

      - name: Install client dependencies
        working-directory: client
        run: bun install

      - name: Build client
        working-directory: client
        run: bun run build

      - name: Move build folder
        run: mv client/build .

      - name: Install server dependencies
        run: bun install

      - name: Generate migrations
        run: bun run generate-migrations

      - name: Generate integrations
        run: bun run generate-integrations

      - name: Create zip archive
        run: zip -r Pixies.zip build server package.json

      - name: Upload to Release
        uses: actions/github-script@v7
        with:
          script: |
            const fs = require('fs');
            await github.rest.repos.uploadReleaseAsset({
              owner: context.repo.owner,
              repo: context.repo.repo,
              release_id: ${{ inputs.release_id }},
              name: 'Pixies.zip',
              data: fs.readFileSync('Pixies.zip')
            });
byte
6.963
baris
256
Jenis
yml
Commit terakhir
26 Oktober 2026