-
Notifications
You must be signed in to change notification settings - Fork 2
115 lines (92 loc) · 3.54 KB
/
release.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
115
name: Release
on:
workflow_dispatch:
release:
types:
- published
jobs:
build_linux_x86_64:
name: Build Linux (x86_64)
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get install -y build-essential pkg-config libssl-dev clang cmake llvm
- name: Install protoc
id: deps-protoc
shell: bash
run: |
curl -Lo /tmp/protoc.zip \
"https://github.com/protocolbuffers/protobuf/releases/download/v28.2/protoc-28.2-linux-x86_64.zip"
unzip -o /tmp/protoc.zip -d ${HOME}/.local
echo "PROTOC=${HOME}/.local/bin/protoc" >> $GITHUB_ENV
export PATH="${PATH}:${HOME}/.local/bin"
- name: Add Rust targets
run: rustup target add x86_64-unknown-linux-gnu
- name: Build for Linux x86
run: cargo build -r --target=x86_64-unknown-linux-gnu && mv target/x86_64-unknown-linux-gnu/release/platform-cli ./platform-cli_gnu-x86_64
- uses: softprops/action-gh-release@v2
with:
files: |
platform-cli_gnu-x86_64
build_linux_arm64:
name: Build Linux (arm64)
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get install -y build-essential pkg-config libssl-dev clang cmake llvm g++-aarch64-linux-gnu gcc-aarch64-linux-gnu libc6-dev-i386 g++-13-multilib gcc-13-multilib && dpkg -l
- name: Install protoc
id: deps-protoc
shell: bash
run: |
curl -Lo /tmp/protoc.zip \
"https://github.com/protocolbuffers/protobuf/releases/download/v28.2/protoc-28.2-linux-x86_64.zip"
unzip -o /tmp/protoc.zip -d ${HOME}/.local
echo "PROTOC=${HOME}/.local/bin/protoc" >> $GITHUB_ENV
export PATH="${PATH}:${HOME}/.local/bin"
- name: Add Rust targets
run: rustup target add aarch64-unknown-linux-gnu
- name: Create Cargo multiarch config
run: |
touch ~/.cargo/config.toml
echo "
[target.aarch64-unknown-linux-gnu]
linker = \"aarch64-linux-gnu-gcc\"
" > ~/.cargo/config.toml
- name: Build for Linux arm64
run: cargo build -r --target=aarch64-unknown-linux-gnu && mv target/aarch64-unknown-linux-gnu/release/platform-cli ./platform-cli-gnu-arm64
build_mac_x86_64:
name: Build Apple (x86_64)
runs-on: macos-13
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Add Rust targets
run: brew install llvm protobuf
- name: Add Rust targets
run: rustup target add x86_64-apple-darwin
- name: Build for Apple x86
run: cargo build -r --target=x86_64-apple-darwin && mv target/x86_64-apple-darwin/release/platform-cli ./platform-cli_darwin-x86_64
- uses: softprops/action-gh-release@v2
with:
files: |
platform-cli_darwin-x86_64
build_mac_arm64:
name: Build Apple (arm64)
runs-on: macos-15
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Add Rust targets
run: brew install llvm protobuf
- name: Add Rust targets
run: rustup target add aarch64-apple-darwin
- name: Build for Apple Silicon
run: cargo build -r --target=aarch64-apple-darwin && mv target/aarch64-apple-darwin/release/platform-cli ./platform-cli_darwin-arm64
- uses: softprops/action-gh-release@v2
with:
files: |
platform-cli_darwin-arm64