chore: bump CLI version to 0.2.1 #14
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: | |
| - 'cli-v*' | |
| workflow_dispatch: | |
| inputs: | |
| dry_run: | |
| description: 'Dry run (skip GitHub release upload)' | |
| required: false | |
| default: false | |
| type: boolean | |
| skip_build: | |
| description: 'Skip build (reuse artifacts from previous run)' | |
| required: false | |
| default: false | |
| type: boolean | |
| run_id: | |
| description: 'Run ID to download artifacts from (required if skip_build is true)' | |
| required: false | |
| type: string | |
| env: | |
| DEBUG: napi:* | |
| MACOSX_DEPLOYMENT_TARGET: '10.13' | |
| permissions: | |
| contents: write | |
| actions: read | |
| jobs: | |
| build: | |
| if: ${{ github.event.inputs.skip_build != 'true' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| settings: | |
| - host: macos-latest | |
| target: x86_64-apple-darwin | |
| build: bun run build --target x86_64-apple-darwin | |
| - host: macos-latest | |
| target: aarch64-apple-darwin | |
| build: bun run build --target aarch64-apple-darwin | |
| - host: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| build: bun run build --target x86_64-unknown-linux-gnu | |
| - host: ubuntu-latest | |
| target: aarch64-unknown-linux-gnu | |
| build: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu | |
| export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc | |
| export CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++ | |
| export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc | |
| bun run build --target aarch64-unknown-linux-gnu | |
| - host: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| build: bun run build --target x86_64-pc-windows-msvc | |
| - host: windows-latest | |
| target: aarch64-pc-windows-msvc | |
| build: bun run build --target aarch64-pc-windows-msvc | |
| name: Build - ${{ matrix.settings.target }} | |
| runs-on: ${{ matrix.settings.host }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.settings.target }} | |
| - name: Install dependencies | |
| run: bun install | |
| working-directory: packages/core | |
| - name: Build native module | |
| run: ${{ matrix.settings.build }} | |
| working-directory: packages/core | |
| shell: bash | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bindings-${{ matrix.settings.target }} | |
| path: packages/core/*.node | |
| if-no-files-found: error | |
| build-universal-macos: | |
| if: ${{ github.event.inputs.skip_build != 'true' }} | |
| name: Build - universal-apple-darwin | |
| needs: build | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| working-directory: packages/core | |
| - name: Download x64 artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: bindings-x86_64-apple-darwin | |
| path: packages/core | |
| - name: Download arm64 artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: bindings-aarch64-apple-darwin | |
| path: packages/core | |
| - name: Create universal binary | |
| run: bun x @napi-rs/cli universalize | |
| working-directory: packages/core | |
| - name: Upload universal artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bindings-universal-apple-darwin | |
| path: packages/core/*.node | |
| if-no-files-found: error | |
| upload-release: | |
| name: Upload to GitHub Release | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| - build-universal-macos | |
| if: ${{ always() && (github.event.inputs.skip_build == 'true' || (needs.build.result == 'success' && needs.build-universal-macos.result == 'success')) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download artifacts from current run | |
| if: ${{ github.event.inputs.skip_build != 'true' }} | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| pattern: bindings-* | |
| merge-multiple: true | |
| - name: Download artifacts from previous run | |
| if: ${{ github.event.inputs.skip_build == 'true' }} | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| pattern: bindings-* | |
| merge-multiple: true | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| run-id: ${{ github.event.inputs.run_id }} | |
| - name: List artifacts | |
| run: ls -la artifacts/ | |
| - name: Get tag name | |
| id: tag | |
| run: | | |
| if [[ "${{ github.ref_type }}" == "tag" ]]; then | |
| echo "name=${{ github.ref_name }}" >> $GITHUB_OUTPUT | |
| else | |
| # For manual runs, use the version from package.json | |
| VERSION=$(jq -r .version packages/cli/package.json) | |
| echo "name=cli-v${VERSION}" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Create or update GitHub Release | |
| if: ${{ github.event.inputs.dry_run != 'true' }} | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.tag.outputs.name }} | |
| name: CLI ${{ steps.tag.outputs.name }} | |
| files: artifacts/*.node | |
| fail_on_unmatched_files: true | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Summary | |
| run: | | |
| echo "## Release ${{ steps.tag.outputs.name }}" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Binaries uploaded to GitHub Release" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| ls -1 artifacts/*.node | while read f; do | |
| echo "- $(basename $f)" >> $GITHUB_STEP_SUMMARY | |
| done | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Next Steps" >> $GITHUB_STEP_SUMMARY | |
| echo "1. Publish CLI to npm locally: \`cd packages/cli && npm publish --access public\`" >> $GITHUB_STEP_SUMMARY | |
| echo "2. Verify: \`bunx vibetracking@latest --version\`" >> $GITHUB_STEP_SUMMARY |