build sea for windows macos and linux #57
Workflow file for this run
This file contains 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: CI | |
on: | |
pull_request: | |
branches: ['main'] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/workflows/composite/build | |
build-seas: | |
name: ${{ matrix.os}} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ['linux', 'macos', 'windows'] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
- name: set the executable name | |
id: set-executable-name | |
uses: actions/github-script@v7 | |
env: | |
MATRIX_OS: ${{ matrix.os }} | |
with: | |
script: | | |
const os = process.env.MATRIX_OS; | |
let executableName = 'hdcli'; | |
if (os === 'windows') { | |
executableName = 'hdcli.exe'; | |
} | |
return executableName; | |
result-encoding: string | |
- name: restore the sea blob from cache | |
uses: actions/cache/restore@v4 | |
with: | |
path: ./dist/apps/cli/hdcli | |
key: hdcli-sea-blob-${{ github.run_id }} | |
- name: copy node to use to create sea | |
if: matrix.os != 'windows' | |
run: cp $(command -v node) hdcli | |
working-directory: ./dist/apps/cli | |
shell: bash | |
- name: copy node to use to create sea | |
if: matrix.os == 'windows' | |
run: node -e "require('fs').copyFileSync(process.execPath, 'hdcli.exe')" | |
working-directory: ./dist/apps/cli | |
shell: bash | |
- name: remove the signature of the binary | |
if: matrix.os == 'macos' | |
run: codesign --remove-signature hdcli | |
working-directory: ./dist/apps/cli | |
shell: bash | |
- name: inject the CLI sea into the copied node | |
if: matrix.os != 'macos' | |
run: npx postject ${{ steps.set-executable-name.outputs.result }} NODE_SEA_BLOB sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 | |
working-directory: ./dist/apps/cli | |
shell: bash | |
- name: inject the CLI sea into the copied node | |
if: matrix.os == 'macos' | |
run: npx postject ${{ steps.set-executable-name.outputs.result }} NODE_SEA_BLOB sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 --macho-segment-name NODE_SEA | |
working-directory: ./dist/apps/cli | |
shell: bash | |
- name: sign the binary | |
if: matrix.os == 'macos' | |
run: codesign --sign - ${{ steps.set-executable-name.outputs.result }} | |
working-directory: ./dist/apps/cli | |
shell: bash | |
- name: sign the binary | |
if: matrix.os == 'windows' | |
run: signtool sign /fd SHA256 ${{ steps.set-executable-name.outputs.result }} | |
working-directory: ./dist/apps/cli | |
shell: bash | |
- name: cache the sea binary | |
uses: actions/cache/save@v4 | |
with: | |
path: ./dist/apps/cli/${{ steps.set-executable-name.outputs.result }} | |
key: hdcli-sea-${{ matrix.os }}-${{ github.run_id }} | |
verify: | |
needs: build | |
uses: ./.github/workflows/runtime-tests.yml |