55 tag :
66 commit :
77 default : ' master'
8+ permissions :
9+ contents : read
810jobs :
911 bun-build :
10- name : build-bun-exes
11- runs-on : ubuntu-latest
12+ name : build-${{ matrix.name }}
13+ runs-on : ${{ matrix.runner }}
14+ strategy :
15+ fail-fast : false
16+ matrix :
17+ include :
18+ - name : windows-x64
19+ runner : windows-latest
20+ bun_target : bun-windows-x64
21+ bin_relpath : out/windows64/anywaydata.exe
22+ zip_name : windows64.zip
23+ smoke_command : .\out\windows64\anywaydata.exe --help
24+ bun_build_flags : --compile --minify --sourcemap
25+ - name : linux-x64
26+ runner : ubuntu-latest
27+ bun_target : bun-linux-x64
28+ bin_relpath : out/linux-x64/anywaydata
29+ zip_name : linux-x64.zip
30+ smoke_command : ./out/linux-x64/anywaydata --help
31+ bun_build_flags : --compile
32+ - name : linux-arm64
33+ runner : ubuntu-24.04-arm
34+ bun_target : bun-linux-arm64
35+ bin_relpath : out/linux-arm64/anywaydata
36+ zip_name : linux-arm64.zip
37+ smoke_command : ./out/linux-arm64/anywaydata --help
38+ bun_build_flags : --compile
39+ - name : macos-arm64
40+ runner : macos-latest
41+ bun_target : bun-darwin-arm64
42+ bin_relpath : out/macos-arm64/anywaydata
43+ zip_name : macos-arm64.zip
44+ smoke_command : ./out/macos-arm64/anywaydata --help
45+ bun_build_flags : --compile
1246 defaults :
1347 run :
1448 working-directory : ./cli
@@ -19,39 +53,43 @@ jobs:
1953 bun-version : 1.2.10
2054 - name : install dependencies
2155 run : bun install
22- - name : build windows
23- run : |
24- bun build ./index.ts --compile --minify --sourcemap --target=bun-windows-x64 --outfile ${{ github.workspace }}/out/windows64/anywaydata.exe
25- zip -j ${{ github.workspace }}/windows64.zip ${{ github.workspace }}/out/windows64/anywaydata.exe
26- - name : build linux-x64
27- run : |
28- bun build ./index.ts --compile --target=bun-linux-x64 --outfile ${{ github.workspace }}/out/linux-x64/anywaydata
29- zip -j ${{ github.workspace }}/linux-x64.zip ${{ github.workspace }}/out/linux-x64/anywaydata
30- - name : build linux-arm64
31- run : |
32- bun build ./index.ts --compile --outfile ${{ github.workspace }}/out/linux-arm64/anywaydata --target=bun-linux-arm64
33- zip -j ${{ github.workspace }}/linux-arm64.zip ${{ github.workspace }}/out/linux-arm64/anywaydata
34- - name : build mac-x64
35- run : |
36- bun build ./index.ts --compile --outfile ${{ github.workspace }}/out/macos-x64/anywaydata --target=bun-darwin-x64
37- zip -j ${{ github.workspace }}/macos-x64.zip ${{ github.workspace }}/out/macos-x64/anywaydata
38- - name : build mac-arm64
56+ - name : build binary
57+ shell : bash
3958 run : |
40- bun build ./index.ts --compile --outfile ${{ github.workspace }}/out/macos-arm64/anywaydata --target=bun-darwin-arm64
41- zip -j ${{ github.workspace }}/macos-arm64.zip ${{ github.workspace }}/out/macos-arm64/anywaydata
42- - name : check dir
43- run : ls -R ${{ github.workspace }}/out
59+ bun build ./index.ts ${{ matrix.bun_build_flags }} --target=${{ matrix.bun_target }} --outfile "${{ github.workspace }}/${{ matrix.bin_relpath }}"
60+ - name : smoke test binary
61+ run : ${{ matrix.smoke_command }}
62+ - name : package zip (windows)
63+ if : runner.os == 'Windows'
64+ shell : powershell
65+ run : Compress-Archive -Path "${{ github.workspace }}\${{ matrix.bin_relpath }}" -DestinationPath "${{ github.workspace }}\${{ matrix.zip_name }}" -Force
66+ - name : package zip (non-windows)
67+ if : runner.os != 'Windows'
68+ shell : bash
69+ run : zip -j "${{ github.workspace }}/${{ matrix.zip_name }}" "${{ github.workspace }}/${{ matrix.bin_relpath }}"
70+ - name : upload zip artifact
71+ uses : actions/upload-artifact@v4
72+ with :
73+ name : ${{ matrix.zip_name }}
74+ path : ${{ github.workspace }}/${{ matrix.zip_name }}
75+ if-no-files-found : error
76+ create-draft-release :
77+ name : create-draft-release
78+ needs : bun-build
79+ runs-on : ubuntu-latest
80+ permissions :
81+ contents : write
82+ steps :
83+ - name : download built zips
84+ uses : actions/download-artifact@v4
85+ with :
86+ path : ${{ github.workspace }}/release-assets
4487 - uses : ncipollo/release-action@v1.16.0
4588 with :
4689 tag : ${{ inputs.tag }}
4790 commit : ${{ inputs.commit }}
4891 name : Draft Release ${{ github.ref }}
4992 draft : true
50- artifacts : |
51- ${{ github.workspace }}/windows64.zip
52- ${{ github.workspace }}/linux-x64.zip
53- ${{ github.workspace }}/linux-arm64.zip
54- ${{ github.workspace }}/macos-x64.zip
55- ${{ github.workspace }}/macos-arm64.zip
93+ artifacts : ${{ github.workspace }}/release-assets/**/*.zip
5694 body : ' AnyWayData CLI versions'
5795 allowUpdates : true
0 commit comments