-
Notifications
You must be signed in to change notification settings - Fork 56
78 lines (66 loc) · 2.05 KB
/
Copy pathrelease-collector.yaml
File metadata and controls
78 lines (66 loc) · 2.05 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
name: Hades-collector
on:
push:
tags:
- collector-v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-musl
- name: Install musl tools
run: sudo apt-get install -y musl-tools
- name: Cache cargo registry & build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
plugins/collector/target
key: ${{ runner.os }}-cargo-collector-${{ hashFiles('plugins/collector/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-collector-
- name: Build
run: cd plugins/collector && make
- name: Strip & checksum
run: |
strip plugins/collector/collector
sha256sum plugins/collector/collector > plugins/collector/checksum.txt
cat plugins/collector/checksum.txt
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: collector
path: |
plugins/collector/collector
plugins/collector/checksum.txt
retention-days: 7
release:
needs: build
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Extract version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: collector
path: /tmp/collector
- name: Package
working-directory: /tmp/collector
run: tar zcvf /tmp/${{ env.RELEASE_VERSION }}.tgz collector checksum.txt
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
draft: true
prerelease: false
name: Release ${{ github.ref_name }}
files: /tmp/${{ env.RELEASE_VERSION }}.tgz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}