Merge pull request #49 from lfglabs-dev/fricoben/bump-0.2.6 #22
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: Build CLI Binaries | |
| on: | |
| push: | |
| tags: | |
| - 'cli-v*' | |
| workflow_dispatch: | |
| env: | |
| DEBUG: napi:* | |
| MACOSX_DEPLOYMENT_TARGET: '10.13' | |
| permissions: | |
| contents: write | |
| actions: read | |
| jobs: | |
| build: | |
| 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: | |
| 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 | |
| summary: | |
| name: Build Summary | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| - build-universal-macos | |
| if: ${{ needs.build.result == 'success' && needs.build-universal-macos.result == 'success' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Get version | |
| id: version | |
| run: | | |
| VERSION=$(jq -r .version packages/cli/package.json) | |
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
| - name: Summary | |
| run: | | |
| echo "## Build Complete - v${{ steps.version.outputs.version }}" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Artifacts Ready for Download" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "All platform binaries have been built and uploaded as artifacts." >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Next Steps (Local Publishing)" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "1. Download artifacts:" >> $GITHUB_STEP_SUMMARY | |
| echo " \`\`\`bash" >> $GITHUB_STEP_SUMMARY | |
| echo " gh run download ${{ github.run_id }} -D ./artifacts" >> $GITHUB_STEP_SUMMARY | |
| echo " \`\`\`" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "2. Run publish script:" >> $GITHUB_STEP_SUMMARY | |
| echo " \`\`\`bash" >> $GITHUB_STEP_SUMMARY | |
| echo " ./scripts/publish-all.sh" >> $GITHUB_STEP_SUMMARY | |
| echo " \`\`\`" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "3. Verify installation:" >> $GITHUB_STEP_SUMMARY | |
| echo " \`\`\`bash" >> $GITHUB_STEP_SUMMARY | |
| echo " bunx vibetracking@${{ steps.version.outputs.version }} --version" >> $GITHUB_STEP_SUMMARY | |
| echo " \`\`\`" >> $GITHUB_STEP_SUMMARY |