-
Notifications
You must be signed in to change notification settings - Fork 56
93 lines (80 loc) · 2.51 KB
/
Copy pathrelease-agent.yaml
File metadata and controls
93 lines (80 loc) · 2.51 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
name: Hades-agent
on:
push:
tags:
- agent-v*
jobs:
build:
name: "Release agent / ${{ matrix.arch }}"
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
runner: ubuntu-latest
target: x86_64-unknown-linux-musl
- arch: aarch64
runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-musl
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
agent/target
key: build-${{ matrix.target }}-${{ hashFiles('agent/Cargo.lock') }}
restore-keys: build-${{ matrix.target }}-
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/cargo-deb
~/.cargo/bin/cargo-generate-rpm
key: cargo-pkg-tools-${{ runner.os }}-${{ runner.arch }}
- name: Install system dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends protobuf-compiler musl-tools
- name: Install packaging tools
run: |
command -v cargo-deb || cargo install cargo-deb
command -v cargo-generate-rpm || cargo install cargo-generate-rpm
- name: Extract version from tag
run: echo "BUILD_VERSION=${GITHUB_REF#refs/tags/agent-v}" >> $GITHUB_ENV
- name: Build and package
run: make -C agent package-musl TARGET=${{ matrix.target }}
- name: Upload .deb
uses: actions/upload-artifact@v4
with:
name: hades-agent-deb-${{ matrix.arch }}
path: /tmp/hades-agent_*.deb
retention-days: 7
- name: Upload .rpm
uses: actions/upload-artifact@v4
with:
name: hades-agent-rpm-${{ matrix.arch }}
path: /tmp/hades-agent-*.rpm
retention-days: 7
release:
needs: build
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: /tmp/packages
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
draft: true
prerelease: false
name: Release ${{ github.ref_name }}
files: /tmp/packages/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}