-
Notifications
You must be signed in to change notification settings - Fork 3
170 lines (137 loc) · 4.24 KB
/
Copy pathrelease.yml
File metadata and controls
170 lines (137 loc) · 4.24 KB
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: Release
on:
push:
tags: ["*"]
env:
CARGO_TERM_COLOR: always
REGISTRY: frknorg
API_IMAGE_NAME: pony-api
DOCKER_TAG: latest
jobs:
build-agent:
runs-on: ubuntu-22.04
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
- armv7-unknown-linux-gnueabihf
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install latest rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
default: true
override: true
- name: Update apt package index
run: sudo apt-get update
- name: Install protobuf-compiler
run: sudo apt-get install -y protobuf-compiler
- name: Install zig
run: pip3 install ziglang
- name: Install cargo-zigbuild
run: cargo install --locked cargo-zigbuild
- name: Add target
run: rustup target add ${{ matrix.target }}
- name: Build for ${{ matrix.target }}
run: cargo zigbuild --release --target ${{ matrix.target }} --bin agent --no-default-features
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: agent-${{ matrix.target }}
path: target/${{ matrix.target }}/release/agent
build-api:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install latest rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
default: true
override: true
- name: Update apt package index
run: sudo apt-get update
- name: Install protobuf-compiler
run: sudo apt-get install -y protobuf-compiler
- name: Build
run: cargo build --release --no-default-features --bin api
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: api
path: target/release/api
build-auth:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install latest rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
default: true
override: true
- name: Update apt package index
run: sudo apt-get update
- name: Install protobuf-compiler
run: sudo apt-get install -y protobuf-compiler
- name: Build
run: cargo build --release --no-default-features --bin auth
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: auth
path: target/release/auth
release:
name: Release
needs: [build-api, build-agent, build-auth]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download all agent artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: agent-*
merge-multiple: false
- name: Download API artifact
uses: actions/download-artifact@v4
with:
name: api
path: artifacts/api
- name: Download Auth artifact
uses: actions/download-artifact@v4
with:
name: auth
path: artifacts/auth
- name: Prepare release files
run: |
mkdir -p release
cp artifacts/agent-x86_64-unknown-linux-gnu/agent release/agent-x86_64
cp artifacts/agent-aarch64-unknown-linux-gnu/agent release/agent-aarch64
cp artifacts/agent-armv7-unknown-linux-gnueabihf/agent release/agent-armv7
cp artifacts/api/api release/api-x86_64
cp artifacts/auth/auth release/auth-x86_64
chmod +x release/*
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
release/api-x86_64
release/auth-x86_64
release/agent-x86_64
release/agent-aarch64
release/agent-armv7
docs/*
README.md
config-agent-example.toml
config-api-example.toml
config-auth-example.toml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}