-
Notifications
You must be signed in to change notification settings - Fork 24
150 lines (132 loc) · 4.16 KB
/
publish-packages.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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Package Build
on:
push:
branches:
- main
- make-rpm
jobs:
get_mm:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install MM DBs
run: |
YOUR_ACCOUNT_ID=${{ secrets.MM_ACCOUNT_ID }} MAXMIND_LICENSE_KEY=${{ secrets.MM_DOWNLOAD_KEY }} ./bin/get_mm.sh
- name: 'Upload MM Geo DB'
uses: actions/upload-artifact@v4
with:
name: GeoLite2-Country.mmdb
path: config/GeoLite2-Country.mmdb
retention-days: 1
- name: 'Upload MM ASN DB'
uses: actions/upload-artifact@v4
with:
name: GeoLite2-ASN.mmdb
path: config/GeoLite2-ASN.mmdb
retention-days: 1
build:
needs: get_mm
runs-on: ubuntu-latest
# There's several of these lists of releases that we're building
# for scattered throughout these workflows. Hopefully one day GH
# makes it possible to define this in one place and then refer to
# it. In the meantime, if you're adding to this list, go look for
# other "matrix" definitions.
strategy:
matrix:
include:
- distro: ubi8
release: 8.10
pkg: rpm
image: redhat/ubi8
- distro: ubi9
release: 9.2
pkg: rpm
image: redhat/ubi9
- distro: ubuntu
release: focal
pkg: deb
image: ubuntu
- distro: ubuntu
release: jammy
pkg: deb
image: ubuntu
- distro: ubuntu
release: lunar
pkg: deb
image: ubuntu
- distro: debian
release: bullseye
pkg: deb
image: debian
- distro: debian
release: buster
pkg: deb
image: debian
- distro: debian
release: bookworm
pkg: deb
image: debian
container:
image: ${{ matrix.image }}:${{ matrix.release }}
# NB: any run steps that need chf src need to have `working-directory: ${{ env.SRCDIR }}`
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get MM Geo
uses: dawidd6/action-download-artifact@v2
with:
name: GeoLite2-Country.mmdb
path: ./config
run_id: ${{ github.run_id }}
- name: Get MM Asn
uses: dawidd6/action-download-artifact@v2
with:
name: GeoLite2-ASN.mmdb
path: ./config
run_id: ${{ github.run_id }}
- name: Set Version
run: |
echo "RELEASE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
echo KENTIK_KTRANSLATE_VERSION=`date +"kt-%Y-%m-%d-${GITHUB_RUN_ID}"` >> $GITHUB_ENV
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.22.6'
- name: Get Deps
run: |
if [ "${{ matrix.distro }}" = "centos" ]
then
yum install -y make gcc diffutils libpcap-devel
elif [ "${{ matrix.distro }}" = "ubi8" ]
then
yum install -y make gcc diffutils libpcap-devel
elif [ "${{ matrix.distro }}" = "ubi9" ]
then
yum install -y make gcc diffutils libpcap-devel
else
apt-get update
apt-get -y install make libpcap-dev ca-certificates build-essential curl
fi
- name: Run Make
run: |
echo ${{ env.KENTIK_KTRANSLATE_VERSION }}
echo ${{ env.RELEASE_VERSION }}
KENTIK_KTRANSLATE_VERSION=${{ env.KENTIK_KTRANSLATE_VERSION }} make
- name: Run Test
run: make test
- name: Create package
id: package
uses: kentik/pkg@master
with:
name: ktranslate
version: ${{ env.KENTIK_KTRANSLATE_VERSION }}
arch: x86_64
format: ${{ matrix.pkg }}
package: ktranslate-package.yml
- name: Upload package artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.package.outputs.package }}--${{ matrix.distro }}-${{ matrix.release }}
path: ${{ steps.package.outputs.package }}