one more #19
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 and Release | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| deploy_linux_amd64: | |
| description: 'Deploy Linux x86_64' | |
| type: boolean | |
| default: true | |
| deploy_linux_arm64: | |
| description: 'Deploy Linux arm64' | |
| type: boolean | |
| default: true | |
| jobs: | |
| build-linux-x86_64: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: debian:bullseye | |
| steps: | |
| - name: Install system dependencies | |
| run: | | |
| apt-get update | |
| apt-get install -y curl git ca-certificates build-essential file | |
| git config --global --add safe.directory '*' | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22' | |
| - name: Install dependencies | |
| run: npm ci --no-audit | |
| - name: Build Linux x86_64 | |
| run: node release/build.js --os linux --arch x86_64 | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-amd64 | |
| path: artifacts/linux-amd64/ | |
| retention-days: 7 | |
| build-linux-arm64: | |
| runs-on: ubuntu-22.04-arm | |
| container: | |
| image: debian:bullseye | |
| steps: | |
| - name: Install system dependencies | |
| run: | | |
| apt-get update | |
| apt-get install -y curl git ca-certificates build-essential file | |
| git config --global --add safe.directory '*' | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22' | |
| - name: Install dependencies | |
| run: npm ci --no-audit | |
| - name: Build Linux arm64 | |
| run: node release/build.js --os linux --arch arm64 | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-arm64 | |
| path: artifacts/linux-arm64/ | |
| retention-days: 7 | |
| deploy: | |
| needs: [build-linux-x86_64, build-linux-arm64] | |
| if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| environment: production | |
| env: | |
| CI_COMMIT_TAG: ${{ github.ref_type == 'tag' && github.ref_name || '' }} | |
| CI_COMMIT_REF_NAME: ${{ github.ref_name }} | |
| CI_COMMIT_SHA: ${{ github.sha }} | |
| BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22' | |
| - name: Install dependencies | |
| run: npm ci --no-audit | |
| - name: Download x86_64 artifacts | |
| if: inputs.deploy_linux_amd64 != false | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: linux-amd64 | |
| path: artifacts/linux-amd64/ | |
| - name: Download arm64 artifacts | |
| if: inputs.deploy_linux_arm64 != false | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: linux-arm64 | |
| path: artifacts/linux-arm64/ | |
| - name: Deploy | |
| run: node release/deploy.js |