forked from canonical/aproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (46 loc) · 1.37 KB
/
release.yaml
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
---
name: Build RPM
on:
release:
types: [published]
jobs:
tests:
uses: ./.github/workflows/tests.yaml
integration-tests:
uses: ./.github/workflows/integration-tests.yaml
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, arm64]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.8
- name: Install Build Dependencies
run: |
sudo apt update
sudo apt install -y rpm make
- name: Build RPM - ${{ matrix.arch }}
run: |
# Get the release name
release_name=$(echo "${GITHUB_REF}" | awk -F'/' '{print $NF}')
# Extract the version from the release name
version=$(echo "${release_name}" | grep -oE "[0-9]+\.[0-9]+\.[0-9]+")
make build ARCH=${{ matrix.arch }} VERSION=${version}
make rpm ARCH=${{ matrix.arch }} VERSION=${version}
- name: Upload RPMs to Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
rpmbuild/RPMS/**/*.rpm
out/*
token: ${{ secrets.GITHUB_TOKEN }}
- name: Job fail
continue-on-error: true
run: |
make clean