Skip to content

Commit

Permalink
Use node sea
Browse files Browse the repository at this point in the history
  • Loading branch information
BSteffaniak committed Aug 26, 2024
1 parent b27332e commit d9f5d99
Showing 1 changed file with 44 additions and 7 deletions.
51 changes: 44 additions & 7 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,19 @@ on:

jobs:
package:
runs-on: ${{ matrix.release.os }}

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
release:
- os: ubuntu-latest
- os: windows-latest
- os: macos-latest

steps:
- uses: actions/checkout@v3

- name: Download Airship ${{ github.event.release.tag_name }}
uses: FlatLang/fetch-airship@master
with:
Expand All @@ -19,15 +28,40 @@ jobs:
with:
node-version: 20

- name: Install pkg
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 9
run_install: false

- name: Prepare binary
shell: bash
run: |
npm install -g pkg
mkdir -p dist/
mv airship.js dist/airship.js
node --experimental-sea-config sea-config.json
- name: Package airship.js
- name: Build windows binary
if: ${{ matrix.release.os == 'windows-latest' }}
shell: bash
run: |
pkg airship.js
cp $(command -v node) airship-win.exe
pnpm dlx postject airship-win.exe NODE_SEA_BLOB dist/sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
- name: Build macos binary
if: ${{ matrix.release.os == 'macos-latest' }}
run: |
cp $(command -v node) airship-macos
pnpm dlx postject airship-macos NODE_SEA_BLOB dist/sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 --macho-segment-name NODE_SEA
- name: Build linux binary
if: ${{ matrix.release.os == 'ubuntu-latest' }}
run: |
cp $(command -v node) airship-linux
pnpm dlx postject airship-linux NODE_SEA_BLOB dist/sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
- name: Delete airship-win.exe Asset
if: ${{ matrix.release.os == 'windows-latest' }}
uses: mknejp/delete-release-assets@v1
with:
fail-if-no-assets: false
Expand All @@ -37,6 +71,7 @@ jobs:
assets: airship-win.exe

- name: Upload Windows Asset
if: ${{ matrix.release.os == 'windows-latest' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -47,6 +82,7 @@ jobs:
asset_content_type: application/octet-stream

- name: Delete airship-macos Asset
if: ${{ matrix.release.os == 'macos-latest' }}
uses: mknejp/delete-release-assets@v1
with:
fail-if-no-assets: false
Expand All @@ -56,6 +92,7 @@ jobs:
assets: airship-macos

- name: Upload Mac Asset
if: ${{ matrix.release.os == 'macos-latest' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -66,6 +103,7 @@ jobs:
asset_content_type: application/octet-stream

- name: Delete airship-linux Asset
if: ${{ matrix.release.os == 'ubuntu-latest' }}
uses: mknejp/delete-release-assets@v1
with:
fail-if-no-assets: false
Expand All @@ -75,6 +113,7 @@ jobs:
assets: airship-linux

- name: Upload Linux Asset
if: ${{ matrix.release.os == 'ubuntu-latest' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -85,7 +124,6 @@ jobs:
asset_content_type: application/octet-stream

compress:

runs-on: ubuntu-latest
needs: package

Expand Down Expand Up @@ -119,7 +157,6 @@ jobs:
content_type: application/x-zip-compressed

steps:

- name: Download airship.js ${{ github.event.release.tag_name }}
uses: FlatLang/fetch-airship@master
with:
Expand Down

0 comments on commit d9f5d99

Please sign in to comment.