Publish standalone binaries #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
| name: Publish standalone binaries | |
| # Invoked by release-please.yml after a GitHub Release is created, so a single | |
| # release produces both the npm package and the standalone binaries. The infra | |
| # Railway proxy (`get.devicecloud.dev`) reads from the GitHub Releases API at | |
| # runtime, so no separate manifest deploy is needed. | |
| on: | |
| workflow_call: | |
| inputs: | |
| tag_name: | |
| description: 'Release tag to upload binaries against (e.g. v5.1.0)' | |
| required: true | |
| type: string | |
| workflow_dispatch: | |
| inputs: | |
| tag_name: | |
| description: 'Release tag to upload binaries against (e.g. v5.1.0). Leave blank to derive from package.json.' | |
| required: false | |
| type: string | |
| jobs: | |
| build-binaries: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # Required to upload release assets | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v6 | |
| with: | |
| run_install: false | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22.x' | |
| cache: 'pnpm' | |
| cache-dependency-path: './pnpm-lock.yaml' | |
| - run: pnpm install --frozen-lockfile | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: '1.3' | |
| - name: Build binaries for all platforms | |
| run: node scripts/build-binaries.mjs | |
| - name: Resolve release tag | |
| id: tag | |
| run: | | |
| if [ -n "${{ inputs.tag_name }}" ]; then | |
| echo "name=${{ inputs.tag_name }}" >> "$GITHUB_OUTPUT" | |
| else | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "name=v${VERSION}" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Upload binaries to GitHub Release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release upload "${{ steps.tag.outputs.name }}" \ | |
| dist-bin/dcd-darwin-arm64 \ | |
| dist-bin/dcd-darwin-x64 \ | |
| dist-bin/dcd-linux-arm64 \ | |
| dist-bin/dcd-linux-x64 \ | |
| dist-bin/dcd-windows-x64.exe \ | |
| dist-bin/SHA256SUMS \ | |
| --clobber |