@@ -20,37 +20,64 @@ jobs:
2020 include :
2121 - target : x86_64-unknown-linux-gnu
2222 os : ubuntu-latest
23- - target : x86_64-pc-windows-msvc
24- os : windows-latest
23+ archive : tar.gz
24+ - target : x86_64-unknown-linux-musl
25+ os : ubuntu-latest
26+ archive : tar.gz
27+ - target : aarch64-unknown-linux-gnu
28+ os : ubuntu-latest
29+ archive : tar.gz
30+ - target : x86_64-apple-darwin
31+ os : macos-latest
32+ archive : tar.gz
2533 - target : aarch64-apple-darwin
2634 os : macos-latest
35+ archive : tar.gz
36+ - target : x86_64-pc-windows-msvc
37+ os : windows-latest
38+ archive : zip
39+
2740 steps :
2841 - uses : actions/checkout@v4
2942 - uses : dtolnay/rust-toolchain@stable
3043 with :
3144 targets : ${{ matrix.target }}
3245 - uses : Swatinem/rust-cache@v2
46+
47+ - name : Install cross-compilation tools (Linux ARM)
48+ if : matrix.target == 'aarch64-unknown-linux-gnu'
49+ run : |
50+ sudo apt-get update
51+ sudo apt-get install -y gcc-aarch64-linux-gnu
52+
53+ - name : Install musl tools
54+ if : matrix.target == 'x86_64-unknown-linux-musl'
55+ run : |
56+ sudo apt-get update
57+ sudo apt-get install -y musl-tools
58+
3359 - name : Build binaries
3460 run : cargo build --release --target ${{ matrix.target }} --bin punkgo-cli --bin punkgo-kerneld
35- - name : Package (Linux)
36- if : runner.os == 'Linux'
37- run : |
38- cd target/${{ matrix.target }}/release
39- tar czf ../../../punkgo-kernel-${{ github.ref_name }}-${{ matrix.target }}.tar.gz punkgo-cli punkgo-kerneld
40- - name : Package (macOS)
41- if : runner.os == 'macOS'
61+ env :
62+ CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER : aarch64-linux-gnu-gcc
63+
64+ - name : Package (Unix)
65+ if : matrix.archive == 'tar.gz'
4266 run : |
4367 cd target/${{ matrix.target }}/release
4468 tar czf ../../../punkgo-kernel-${{ github.ref_name }}-${{ matrix.target }}.tar.gz punkgo-cli punkgo-kerneld
69+
4570 - name : Package (Windows)
46- if : runner.os == 'Windows'
71+ if : matrix.archive == 'zip'
72+ shell : pwsh
4773 run : |
48- cd target/${{ matrix.target }}/release
49- 7z a ../../../punkgo-kernel-${{ github.ref_name }}-${{ matrix.target }}.zip punkgo-cli.exe punkgo-kerneld.exe
50- - uses : actions/upload-artifact@v4
74+ Compress-Archive -Path target/${{ matrix.target }}/release/punkgo-cli.exe,target/${{ matrix.target }}/release/punkgo-kerneld.exe -DestinationPath punkgo-kernel-${{ github.ref_name }}-${{ matrix.target }}.zip
75+
76+ - name : Upload artifact
77+ uses : actions/upload-artifact@v4
5178 with :
52- name : ${{ matrix.target }}
53- path : punkgo-kernel-${{ github.ref_name }}-*
79+ name : punkgo-kernel- ${{ matrix.target }}
80+ path : punkgo-kernel-${{ github.ref_name }}-${{ matrix.target }}.${{ matrix.archive }}
5481
5582 release :
5683 name : Create Release
6087 - uses : actions/checkout@v4
6188 - uses : actions/download-artifact@v4
6289 with :
63- merge-multiple : true
90+ path : artifacts
6491 - name : Create GitHub Release
6592 uses : softprops/action-gh-release@v2
6693 with :
67- files : |
68- punkgo-kernel-*.tar.gz
69- punkgo-kernel-*.zip
70- draft : false
71- prerelease : false
94+ generate_release_notes : true
95+ files : artifacts/**/*
0 commit comments