-
Notifications
You must be signed in to change notification settings - Fork 9
66 lines (65 loc) · 2.19 KB
/
publish-serverless-agent.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
name: Build and Release Serverless Agent
on:
push:
tags:
- 'sls-**'
jobs:
build-linux-musl:
name: Build Linux Musl
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Protoc Binary
shell: bash
run: chmod +x ./scripts/install-protoc.sh && ./scripts/install-protoc.sh $HOME
- name: Install musl dependencies
run: rustup target add x86_64-unknown-linux-musl && sudo apt-get install musl-tools
- name: Build project
shell: bash
run: cargo build --release -p datadog-serverless-trace-mini-agent --target x86_64-unknown-linux-musl
- name: Upload artifacts for release step
uses: actions/upload-artifact@v4
with:
name: datadog-serverless-agent-linux-amd64
path: target/x86_64-unknown-linux-musl/release/datadog-serverless-trace-mini-agent
build-windows:
name: Build Windows
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Protoc Binary
shell: bash
run: chmod +x ./scripts/install-protoc.sh && ./scripts/install-protoc.sh $HOME
- name: Build project
shell: bash
run: cargo build --release -p datadog-serverless-trace-mini-agent
- name: Upload artifacts for release step
uses: actions/upload-artifact@v4
with:
name: datadog-serverless-agent-windows-amd64
path: target/release/datadog-serverless-trace-mini-agent.exe
release:
name: Zip and Release
needs: [build-windows, build-linux-musl]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download artifacts from build step
uses: actions/download-artifact@v4
with:
path: target/release/binaries
- name: UPX compress binaries
run: |
for file in target/release/binaries/*/*
do
chmod +x "$file"
upx "$file" --lzma
done
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: datadog-serverless-agent
path: target/release/binaries/*/*