Skip to content

Commit

Permalink
Switch to bun for binary generation
Browse files Browse the repository at this point in the history
Do not merge yet: code signing via ldid is not working for MacOS.
  • Loading branch information
max-leuthaeuser committed Oct 7, 2024
1 parent e957281 commit f2b8d4c
Show file tree
Hide file tree
Showing 4 changed files with 274 additions and 949 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Install node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'
Expand All @@ -30,15 +30,22 @@ jobs:
mv astgen-macos-x64 astgen-macos
mv astgen-macos-arm64 astgen-macos-arm
mv astgen-win-x64.exe astgen-win.exe
- name: Run gzexe
run: |
gzexe astgen-linux
gzexe astgen-linux-arm
gzexe astgen-macos
gzexe astgen-macos-arm
gzexe astgen-win.exe
- name: Make executable
run: |
chmod +x astgen-macos
chmod +x astgen-macos-arm
chmod +x astgen-linux
chmod +x astgen-linux-arm
gzexe astgen-linux
gzexe astgen-linux-arm
- name: Print stats
run: |
ls -lh
- name: Print version
run: |
./astgen-linux --version
mv astgen-linux~ astgen-linux-uncompressed
mv astgen-linux-arm~ astgen-linux-arm-uncompressed
17 changes: 9 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Install node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'
Expand Down Expand Up @@ -46,16 +46,19 @@ jobs:
mv astgen-macos-x64 astgen-macos
mv astgen-macos-arm64 astgen-macos-arm
mv astgen-win-x64.exe astgen-win.exe
- name: Run gzexe
run: |
gzexe astgen-linux
gzexe astgen-linux-arm
gzexe astgen-macos
gzexe astgen-macos-arm
gzexe astgen-win.exe
- name: Make executable
run: |
chmod +x astgen-macos
chmod +x astgen-macos-arm
chmod +x astgen-linux
chmod +x astgen-linux-arm
gzexe astgen-linux
gzexe astgen-linux-arm
mv astgen-linux~ astgen-linux-uncompressed
mv astgen-linux-arm~ astgen-linux-arm-uncompressed
- name: Set next release version
id: taggerFinal
uses: anothrNick/github-tag-action@1.61.0
Expand All @@ -72,5 +75,3 @@ jobs:
astgen-macos-arm
astgen-linux
astgen-linux-arm
astgen-linux-uncompressed
astgen-linux-arm-uncompressed
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@joernio/astgen",
"version": "3.16.0",
"version": "3.17.0",
"description": "Generate JS/TS AST in json format with Babel",
"exports": "./index.js",
"keywords": [
Expand All @@ -19,7 +19,12 @@
"yargs": "^17.7.2"
},
"scripts": {
"postinstall": "pkg . --options max-old-space-size=8192 --no-bytecode --no-native-build --public --compress GZip --targets node18-linux-x64,node18-linux-arm64,node18-macos-x64,node18-win-x64,node18-macos-arm64"
"build_win": "bun build --compile --target=bun-windows-x64 --minify --sourcemap --bytecode ./bin/astgen.js --outfile astgen-win-x64.exe",
"build_linux": "bun build --compile --target=bun-linux-x64 --minify --sourcemap --bytecode ./bin/astgen.js --outfile astgen-linux-x64",
"build_linux_arm": "bun build --compile --target=bun-linux-arm64 --minify --sourcemap --bytecode ./bin/astgen.js --outfile astgen-linux-arm64",
"build_macos": "bun build --compile --target=bun-darwin-x64 --minify --sourcemap --bytecode ./bin/astgen.js --outfile astgen-macos-x64",
"build_macos_arm": "bun build --compile --target=bun-darwin-arm64 --minify --sourcemap --bytecode ./bin/astgen.js --outfile astgen-macos-arm64",
"postinstall": "yarn build_win && yarn build_linux && yarn build_linux_arm && yarn build_macos && yarn build_macos_arm"
},
"engines": {
"node": ">=16.0.0"
Expand All @@ -30,6 +35,6 @@
],
"devDependencies": {
"cross-env": "^7.0.3",
"pkg": "^5.8.1"
"bun": "1.1.29"
}
}
Loading

0 comments on commit f2b8d4c

Please sign in to comment.