Skip to content

Commit

Permalink
Switch to bun for binary generation
Browse files Browse the repository at this point in the history
  • Loading branch information
max-leuthaeuser committed Oct 29, 2024
1 parent e957281 commit 281e04d
Show file tree
Hide file tree
Showing 4 changed files with 268 additions and 957 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@ 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'
- name: Install ldid
uses: MOZGIII/install-ldid-action@v1
with:
tag: v2.1.5-procursus6
- name: Build
run: yarn install
- name: Rename
Expand All @@ -30,15 +26,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
21 changes: 9 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,14 @@ 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'
- name: Install ldid
uses: MOZGIII/install-ldid-action@v1
with:
tag: v2.1.5-procursus6
- name: Get next release version (dry run)
id: taggerDryRun
uses: anothrNick/[email protected]
Expand All @@ -46,16 +42,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/[email protected]
Expand All @@ -72,5 +71,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 281e04d

Please sign in to comment.