Skip to content

Commit 2a95124

Browse files
committed
feat: Make bun binary instead of pkg node for the cli
1 parent cad3187 commit 2a95124

5 files changed

Lines changed: 2709 additions & 86 deletions

File tree

.github/workflows/bun-binary.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Package Binary with Bun
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
arch:
7+
default: x64
8+
description: The architecture to build for eg x64 | arm64
9+
required: true
10+
type: string
11+
edge:
12+
default: false
13+
description: Whether to build on the edge channel or not
14+
required: false
15+
type: boolean
16+
filename:
17+
default: lando
18+
description: The name of the resulting binary
19+
required: false
20+
type: string
21+
bun-version:
22+
default: "1.3.4"
23+
description: The bun version to use
24+
required: false
25+
type: string
26+
os:
27+
default: linux
28+
description: The os to build for eg linux | macos | win
29+
required: true
30+
type: string
31+
version:
32+
default: dev
33+
description: The version to bump the package.json to
34+
required: true
35+
type: string
36+
37+
jobs:
38+
bun-binary:
39+
runs-on: ${{ inputs.arch == 'arm64' && 'macos-14' || 'ubuntu-24.04' }}
40+
env:
41+
TERM: xterm
42+
steps:
43+
- name: Checkout code
44+
uses: actions/checkout@v4
45+
with:
46+
fetch-depth: 0
47+
- name: Install Bun
48+
uses: oven-sh/setup-bun@v2
49+
with:
50+
bun-version: ${{ inputs.bun-version }}
51+
- name: Install dependencies
52+
run: bun install --production
53+
- name: Switch to edge channel
54+
if: inputs.edge == true
55+
run: |
56+
sed -i.bak "s/^channel: stable/channel: edge/" config.yml
57+
rm -rf config.yml.bak
58+
- name: Prepare Release
59+
uses: lando/prepare-release-action@v3
60+
with:
61+
version: ${{ inputs.version }}
62+
sync: false
63+
- name: Package into binary with Bun
64+
run: |
65+
bun build bin/lando --compile --outfile dist/${{ inputs.filename }}
66+
chmod +x dist/${{ inputs.filename }}
67+
- name: Upload artifact
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: packaged-${{ inputs.filename }}-${{ inputs.os }}-${{ inputs.arch }}-${{ github.sha }}
71+
path: dist/${{ inputs.filename }}
72+
- name: Ensure version
73+
if: (inputs.os == 'linux' && runner.os == 'Linux') || (inputs.os == 'macos' && runner.os == 'macOS')
74+
run: ./dist/${{ inputs.filename }} version --all
75+
- name: Ensure channel
76+
if: (inputs.os == 'linux' && runner.os == 'Linux') || (inputs.os == 'macos' && runner.os == 'macOS')
77+
run: ./dist/${{ inputs.filename }} config --path channel | grep ${{ inputs.edge == true && 'edge' || 'stable' }}

.github/workflows/pkg-binary.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ jobs:
5151
cache: npm
5252
- name: Install dependencies
5353
run: npm clean-install --prefer-offline --frozen-lockfile --production
54-
- name: Install plugins
55-
run: scripts/install-plugins.sh --lando bin/lando ${{ inputs.edge == true && '--edge' || '' }}
54+
#- name: Install plugins
55+
# run: scripts/install-plugins.sh --lando bin/lando ${{ inputs.edge == true && '--edge' || '' }}
5656
- name: Switch to edge channel
5757
if: inputs.edge == true
5858
run: |
@@ -85,5 +85,5 @@ jobs:
8585
- name: Ensure plugin install
8686
if: ((inputs.os == 'linux' && runner.os == 'Linux') || (inputs.os == 'macos' && runner.os == 'macOS'))
8787
run: |
88-
./dist/${{ inputs.filename }} config --path fatcore | grep true
89-
./dist/${{ inputs.filename }} config | grep -q "/snapshot/core/plugins/wordpress"
88+
./dist/${{ inputs.filename }} config --path fatcore | grep false
89+
#./dist/${{ inputs.filename }} config | grep -q "/snapshot/core/plugins/wordpress"

.github/workflows/release.yml

Lines changed: 80 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,25 @@ on:
66
- created
77

88
jobs:
9-
# package:
10-
# uses: ./.github/workflows/pkg-binary.yml
11-
# strategy:
12-
# fail-fast: false
13-
# matrix:
14-
# arch:
15-
# - x64
16-
# - arm64
17-
# os:
18-
# - linux
19-
# - macos
20-
# - wi#n
21-
22-
# with:
23-
# arch: ${{ matrix.arch }}
24-
# edge: ${{ github.event.release.prerelease }}
25-
# filename: lando-${{ matrix.os }}-${{ matrix.arch }}-${{ github.ref_name }}
26-
# node-version: "20"
27-
# os: ${{ matrix.os }}
28-
# version: ${{ github.event.release.tag_name }#}
9+
package:
10+
uses: ./.github/workflows/bun-binary.yml
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
arch:
15+
- x64
16+
- arm64
17+
os:
18+
- linux
19+
- macos
20+
- win
21+
22+
with:
23+
arch: ${{ matrix.arch }}
24+
edge: ${{ github.event.release.prerelease }}
25+
filename: lando-${{ matrix.os }}-${{ matrix.arch }}-${{ github.ref_name }}
26+
os: ${{ matrix.os }}
27+
version: ${{ github.event.release.tag_name }#}
2928

3029
# sign:
3130
# uses: ./.github/workflows/sign-binary.yml
@@ -55,55 +54,55 @@ jobs:
5554
# keylocker-cert-sha1-hash: ${{ secrets.KEYLOCKER_CERT_SHA1_HASH }}
5655
# keylocker-keypair-alias: ${{ secrets.KEYLOCKER_KEYPAIR_ALIAS }#}
5756

58-
# build-release-binary-alias:
59-
# uses: ./.github/workflows/release-rename-binary.yml
60-
# needs:
61-
# - sign
62-
# strategy:
63-
# fail-fast: false
64-
# matrix:
65-
# arch:
66-
# - x64
67-
# - arm64
68-
# os:
69-
# - linux
70-
# - macos
71-
# - win
72-
# alias: ${{ github.event.release.prerelease == true && fromJson('["edge"]') || fromJson('["stable", "edge"]') }#}
73-
74-
# with:
75-
# source: lando-${{ matrix.os }}-${{ matrix.arch }}-${{ github.ref_name }}
76-
# destination: lando-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.alias }}
77-
# download-pattern: signed-lando-*
78-
# build-release-binary-tag:
79-
# uses: ./.github/workflows/release-rename-binary.yml
80-
# needs:
81-
# - sign
82-
# strategy:
83-
# fail-fast: false
84-
# matrix:
85-
# arch:
86-
# - x64
87-
# - arm64
88-
# os:
89-
# - linux
90-
# - macos
91-
# - win
92-
# with:
93-
# source: lando-${{ matrix.os }}-${{ matrix.arch }}-${{ github.ref_name }}
94-
# destination: lando-${{ matrix.os }}-${{ matrix.arch }}-${{ github.ref_name }}
95-
# download-pattern: signed-lando-#*
96-
97-
# checksum:
98-
# uses: ./.github/workflows/generate-checksums.yml
99-
# needs:
100-
# - build-release-binary-alias
101-
# - build-release-binary-tag
102-
# with:
103-
# download-pattern: release-*-${{ github.ref_name }}*
104-
# flatten: true
105-
# show: true
106-
# upload-name: release-checksums-${{ github.ref_name }}
57+
build-release-binary-alias:
58+
uses: ./.github/workflows/release-rename-binary.yml
59+
needs:
60+
- package
61+
strategy:
62+
fail-fast: false
63+
matrix:
64+
arch:
65+
- x64
66+
- arm64
67+
os:
68+
- linux
69+
- macos
70+
- win
71+
alias: ${{ github.event.release.prerelease == true && fromJson('["edge"]') || fromJson('["stable", "edge"]') }#}
72+
73+
with:
74+
source: lando-${{ matrix.os }}-${{ matrix.arch }}-${{ github.ref_name }}
75+
destination: lando-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.alias }}
76+
download-pattern: packaged-lando-*
77+
build-release-binary-tag:
78+
uses: ./.github/workflows/release-rename-binary.yml
79+
needs:
80+
- sign
81+
strategy:
82+
fail-fast: false
83+
matrix:
84+
arch:
85+
- x64
86+
- arm64
87+
os:
88+
- linux
89+
- macos
90+
- win
91+
with:
92+
source: lando-${{ matrix.os }}-${{ matrix.arch }}-${{ github.ref_name }}
93+
destination: lando-${{ matrix.os }}-${{ matrix.arch }}-${{ github.ref_name }}
94+
download-pattern: packaged-lando-#*
95+
96+
checksum:
97+
uses: ./.github/workflows/generate-checksums.yml
98+
needs:
99+
- build-release-binary-alias
100+
- build-release-binary-tag
101+
with:
102+
download-pattern: release-*-${{ github.ref_name }}*
103+
flatten: true
104+
show: true
105+
upload-name: release-checksums-${{ github.ref_name }}
107106
# checksum-s3-aliases:
108107
# uses: ./.github/workflows/generate-checksums.yml
109108
# strategy:
@@ -134,18 +133,18 @@ jobs:
134133
# aws-secret-access-key: ${{ secrets.S3_SECRET_ACCESS_KEY }}
135134
# aws-access-key-id: ${{ secrets.S3_ACCESS_KEY_ID }}
136135
# aws-region: us-east-1
137-
# deploy-releases-artifacts:
138-
# uses: ./.github/workflows/deploy-artifacts.yml
139-
# needs:
140-
# - checksum
141-
# with:
142-
# download-pattern: release-*
143-
# deploy-releases-releases:
144-
# uses: ./.github/workflows/deploy-releases.yml
145-
# needs:
146-
# - checksum
147-
# with:
148-
# download-pattern: release-*-${{ github.ref_name }}*
136+
deploy-releases-artifacts:
137+
uses: ./.github/workflows/deploy-artifacts.yml
138+
needs:
139+
- checksum
140+
with:
141+
download-pattern: release-*
142+
deploy-releases-releases:
143+
uses: ./.github/workflows/deploy-releases.yml
144+
needs:
145+
- checksum
146+
with:
147+
download-pattern: release-*-${{ github.ref_name }}*
149148
deploy-npm:
150149
uses: ./.github/workflows/deploy-npm.yml
151150
secrets:

0 commit comments

Comments
 (0)