Merge pull request #280 from DataDog/ivoanjo/very-proto-files-try-2 #31
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v3 | |
- name: Install musl dependencies | |
run: rustup target add x86_64-unknown-linux-musl && sudo apt-get install musl-tools | |
- name: Build project | |
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@v3 | |
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@v3 | |
- name: Build project | |
run: cargo build --release -p datadog-serverless-trace-mini-agent | |
- name: Upload artifacts for release step | |
uses: actions/upload-artifact@v3 | |
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@v3 | |
- name: Download artifacts from build step | |
uses: actions/download-artifact@v3 | |
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: Zip binaries | |
run: zip -r datadog-serverless-agent.zip * | |
working-directory: target/release/binaries | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
generate_release_notes: true | |
files: target/release/binaries/datadog-serverless-agent.zip |