-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (98 loc) · 4.32 KB
/
build_utils.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Publish utilities on release
on:
push:
tags: [ 'utils-*.*.*' ]
env:
BINARIES: "--bin czutil --bin pakutil"
permissions:
contents: write
jobs:
build:
name: Build binaries for Windows and Linux
runs-on: ubuntu-latest
steps:
- name: '📄 Checkout'
uses: actions/checkout@v4
- name: '⚙️ Set up Rust environment'
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: x86_64-pc-windows-gnu, i686-pc-windows-gnu, x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu
- name: '🔽 Cache Rust dependencies'
uses: actions/cache@v4
with:
path: target
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.OS }}-build-
- name: '🔄 Set up additional requirements'
run: |
sudo apt-get install -y gcc-mingw-w64
pip install cargo-zigbuild
- name: '📦 Package Windows x86_64'
run: |
cd ${{github.workspace}}
cargo build --profile production --target x86_64-pc-windows-gnu $BINARIES
zip -j lbee-utils_Windows-x86_64.zip target/x86_64-pc-windows-gnu/production/czutil.exe target/x86_64-pc-windows-gnu/production/pakutil.exe
gh release upload ${{ github.ref_name }} lbee-utils_Windows-x86_64.zip
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
shell: bash
- name: '📦 Package Windows i686'
run: |
cd ${{github.workspace}}
cargo build --profile production --target i686-pc-windows-gnu $BINARIES
zip -j lbee-utils_Windows-x86.zip target/i686-pc-windows-gnu/production/czutil.exe target/i686-pc-windows-gnu/production/pakutil.exe
gh release upload ${{ github.ref_name }} lbee-utils_Windows-x86.zip
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
shell: bash
- name: '📦 Package Linux x86_64'
run: |
cd ${{github.workspace}}
cargo build --profile production --target x86_64-unknown-linux-gnu $BINARIES
zip -j lbee-utils_Linux-x86_64.zip target/x86_64-unknown-linux-gnu/production/czutil target/x86_64-unknown-linux-gnu/production/pakutil
gh release upload ${{ github.ref_name }} lbee-utils_Linux-x86_64.zip
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
shell: bash
- name: '📦 Package Linux aarch64'
run: |
cd ${{github.workspace}}
cargo zigbuild --profile production --target aarch64-unknown-linux-gnu $BINARIES
zip -j lbee-utils_Linux-Arm64.zip target/aarch64-unknown-linux-gnu/production/czutil target/aarch64-unknown-linux-gnu/production/pakutil
gh release upload ${{ github.ref_name }} lbee-utils_Linux-Arm64.zip
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
shell: bash
build-mac:
name: Build binaries for MacOS
runs-on: macos-14
steps:
- name: '📄 Checkout'
uses: actions/checkout@v4
- name: '⚙️ Set up Rust environment'
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: x86_64-apple-darwin, aarch64-apple-darwin
- name: '🔽 Cache Rust dependencies'
uses: actions/cache@v4
with:
path: target
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.OS }}-build-
- name: '🔄 Set up additional requirements'
run: |
brew install zig
cargo install --locked cargo-zigbuild
- name: '📦 Package MacOS Universal2'
run: |
cd ${{github.workspace}}
cargo zigbuild --manifest-path "utils/Cargo.toml" --profile production --target universal2-apple-darwin $BINARIES
zip -j lbee-utils_Mac-Universal.zip target/universal2-apple-darwin/production/czutil target/universal2-apple-darwin/production/pakutil
gh release upload ${{ github.ref_name }} lbee-utils_Mac-Universal.zip
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
shell: bash