release(final): finalize v1.0.16 release and update release_log for v… #20
Workflow file for this run
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: Release CLI | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| jobs: | |
| meta: | |
| name: Resolve tag metadata | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tag: ${{ steps.resolve.outputs.tag }} | |
| version: ${{ steps.resolve.outputs.version }} | |
| prerelease: ${{ steps.resolve.outputs.prerelease }} | |
| steps: | |
| - id: resolve | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| tag="${GITHUB_REF_NAME}" | |
| if [[ ! "$tag" =~ ^v([0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z.-]+)?)$ ]]; then | |
| echo "Tag '$tag' is not a valid semver release tag (expected vX.Y.Z)." >&2 | |
| exit 1 | |
| fi | |
| version="${BASH_REMATCH[1]}" | |
| prerelease="false" | |
| if [[ "$version" == *"-"* ]]; then | |
| prerelease="true" | |
| fi | |
| echo "tag=$tag" >> "$GITHUB_OUTPUT" | |
| echo "version=$version" >> "$GITHUB_OUTPUT" | |
| echo "prerelease=$prerelease" >> "$GITHUB_OUTPUT" | |
| publish_npm: | |
| name: Publish @pushpalsdev/cli to npm | |
| runs-on: ubuntu-latest | |
| needs: meta | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: "1.3.9" | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Set CLI package version from tag | |
| shell: bash | |
| run: | | |
| node -e "const fs=require('fs');const path='packages/cli/package.json';const pkg=JSON.parse(fs.readFileSync(path,'utf8'));pkg.version='${{ needs.meta.outputs.version }}';fs.writeFileSync(path,JSON.stringify(pkg,null,2)+'\n');" | |
| - name: Build CLI package payload | |
| run: bun run --cwd packages/cli build | |
| - name: Publish to npm | |
| working-directory: packages/cli | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: | | |
| if [ -z "${NODE_AUTH_TOKEN:-}" ]; then | |
| echo "NPM_TOKEN secret is required to publish @pushpalsdev/cli." >&2 | |
| exit 1 | |
| fi | |
| npm publish --access public --provenance | |
| build_binaries: | |
| name: Build standalone CLI binaries | |
| needs: meta | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: bun-linux-x64 | |
| output_name: pushpals-linux-x64 | |
| - target: bun-windows-x64 | |
| output_name: pushpals-windows-x64.exe | |
| - target: bun-darwin-x64 | |
| output_name: pushpals-macos-x64 | |
| - target: bun-darwin-arm64 | |
| output_name: pushpals-macos-arm64 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: "1.3.9" | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build standalone binary | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| mkdir -p dist | |
| output="dist/${{ matrix.output_name }}" | |
| bun build scripts/pushpals-cli.ts --compile --target=${{ matrix.target }} --outfile "$output" | |
| if [[ "${{ matrix.target }}" != "bun-windows-x64" ]]; then | |
| chmod +x "$output" | |
| fi | |
| - name: Upload binary artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.output_name }} | |
| path: dist/${{ matrix.output_name }} | |
| build_runtime_binaries: | |
| name: Build standalone runtime service binaries | |
| needs: meta | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: bun-linux-x64 | |
| platform_key: linux-x64 | |
| - target: bun-windows-x64 | |
| platform_key: windows-x64 | |
| - target: bun-darwin-x64 | |
| platform_key: macos-x64 | |
| - target: bun-darwin-arm64 | |
| platform_key: macos-arm64 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: "1.3.9" | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build protocol workspace artifacts | |
| run: bun run protocol:build | |
| - name: Build runtime binaries | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| mkdir -p dist | |
| ext="" | |
| if [[ "${{ matrix.platform_key }}" == windows-* ]]; then | |
| ext=".exe" | |
| fi | |
| bun build apps/server/src/server_main.ts --compile --target=${{ matrix.target }} --outfile "dist/pushpals-runtime-server-${{ matrix.platform_key }}${ext}" | |
| bun build apps/localbuddy/src/localbuddy_main.ts --compile --target=${{ matrix.target }} --outfile "dist/pushpals-runtime-localbuddy-${{ matrix.platform_key }}${ext}" | |
| bun build apps/remotebuddy/src/remotebuddy_main.ts --compile --target=${{ matrix.target }} --outfile "dist/pushpals-runtime-remotebuddy-${{ matrix.platform_key }}${ext}" | |
| bun build apps/workerpals/src/workerpals_main.ts --compile --target=${{ matrix.target }} --outfile "dist/pushpals-runtime-workerpals-${{ matrix.platform_key }}${ext}" | |
| bun build apps/source_control_manager/src/source_control_manager_main.ts --compile --target=${{ matrix.target }} --outfile "dist/pushpals-runtime-source-control-manager-${{ matrix.platform_key }}${ext}" | |
| if [[ "${{ matrix.platform_key }}" != windows-* ]]; then | |
| chmod +x dist/pushpals-runtime-*-${{ matrix.platform_key }} | |
| fi | |
| - name: Upload runtime artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: runtime-${{ matrix.platform_key }} | |
| path: dist/pushpals-runtime-* | |
| publish_release: | |
| name: Publish GitHub release assets | |
| runs-on: ubuntu-latest | |
| needs: | |
| - meta | |
| - publish_npm | |
| - build_binaries | |
| - build_runtime_binaries | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download binaries | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Generate checksums | |
| shell: bash | |
| run: | | |
| cd dist | |
| sha256sum pushpals-* > SHA256SUMS.txt | |
| - name: Resolve release log file | |
| id: release_log | |
| shell: bash | |
| run: | | |
| path="release_log.md" | |
| if [[ -f "$path" ]]; then | |
| echo "found=true" >> "$GITHUB_OUTPUT" | |
| echo "path=$path" >> "$GITHUB_OUTPUT" | |
| echo "Using release log at $path" | |
| else | |
| echo "found=false" >> "$GITHUB_OUTPUT" | |
| echo "path=" >> "$GITHUB_OUTPUT" | |
| echo "No release log found at $path; using default release body." | |
| fi | |
| - name: Create GitHub release (release log) | |
| if: steps.release_log.outputs.found == 'true' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ needs.meta.outputs.tag }} | |
| name: PushPals CLI ${{ needs.meta.outputs.tag }} | |
| prerelease: ${{ needs.meta.outputs.prerelease == 'true' }} | |
| generate_release_notes: true | |
| body_path: ${{ steps.release_log.outputs.path }} | |
| files: | | |
| dist/pushpals-* | |
| dist/SHA256SUMS.txt | |
| - name: Create GitHub release (default body) | |
| if: steps.release_log.outputs.found != 'true' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ needs.meta.outputs.tag }} | |
| name: PushPals CLI ${{ needs.meta.outputs.tag }} | |
| prerelease: ${{ needs.meta.outputs.prerelease == 'true' }} | |
| generate_release_notes: true | |
| body: | | |
| ## Install | |
| - npm: `npm i -g @pushpalsdev/cli` | |
| - bun: `bun install -g @pushpalsdev/cli` | |
| ## Direct downloads | |
| Use the platform binaries attached to this release when npm/Bun is unavailable. | |
| files: | | |
| dist/pushpals-* | |
| dist/SHA256SUMS.txt |