cli #60
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 | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build: | |
| name: Build / ${{ matrix.label }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| label: linux-x64 | |
| output: contexa-linux-x64 | |
| - os: macos-latest | |
| label: macos-arm64 | |
| output: contexa-macos-arm64 | |
| - os: windows-latest | |
| label: win-x64 | |
| output: contexa-win-x64.exe | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - run: npm install | |
| - name: Run unit tests | |
| run: npm test | |
| - name: Bundle | |
| run: npx esbuild src/index.js --bundle --platform=node --target=node18 --outfile=dist/bundle.js --format=cjs | |
| - name: SEA blob | |
| run: node --experimental-sea-config sea-config.json | |
| - name: Build binary (Linux/Mac) | |
| if: runner.os != 'Windows' | |
| run: | | |
| cp $(which node) dist/${{ matrix.output }} | |
| npx postject dist/${{ matrix.output }} NODE_SEA_BLOB dist/sea-prep.blob \ | |
| --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 \ | |
| ${{ runner.os == 'macOS' && '--macho-segment-name NODE_SEA' || '' }} | |
| chmod +x dist/${{ matrix.output }} | |
| ${{ runner.os == 'macOS' && 'codesign --sign - dist/' || 'echo done #' }}${{ matrix.output }} | |
| - name: Build binary (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| copy "$env:programfiles\nodejs\node.exe" dist\${{ matrix.output }} | |
| npx postject dist\${{ matrix.output }} NODE_SEA_BLOB dist\sea-prep.blob ` | |
| --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.output }} | |
| path: dist/${{ matrix.output }} | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: dist/ | |
| # Generate SHA-256 sidecars next to each binary so the install-ctxa | |
| # installers (install.sh / install.ps1) can verify the download against | |
| # a tamper-evident digest before chmod +x. | |
| - name: Generate SHA-256 checksums | |
| run: | | |
| set -e | |
| for f in \ | |
| dist/contexa-linux-x64/contexa-linux-x64 \ | |
| dist/contexa-macos-arm64/contexa-macos-arm64 \ | |
| dist/contexa-win-x64.exe/contexa-win-x64.exe; do | |
| sha256sum "$f" | awk '{print $1}' > "$f.sha256" | |
| echo "$(cat "$f.sha256") $(basename "$f")" | |
| done | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| name: Contexa CLI ${{ github.ref_name }} | |
| body: | | |
| ## Install | |
| ```bash | |
| curl -fsSL https://install.ctxa.ai | sh | |
| ``` | |
| The installer verifies a SHA-256 digest published next to each binary. | |
| files: | | |
| dist/contexa-linux-x64/contexa-linux-x64 | |
| dist/contexa-linux-x64/contexa-linux-x64.sha256 | |
| dist/contexa-macos-arm64/contexa-macos-arm64 | |
| dist/contexa-macos-arm64/contexa-macos-arm64.sha256 | |
| dist/contexa-win-x64.exe/contexa-win-x64.exe | |
| dist/contexa-win-x64.exe/contexa-win-x64.exe.sha256 |