-
Notifications
You must be signed in to change notification settings - Fork 16
205 lines (188 loc) · 7.05 KB
/
cpack.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: CI package
on:
workflow_dispatch:
push:
paths:
- programs/ziti-edge-tunnel/package/*
- .github/actions/openziti-tunnel-build-action/*
- .github/workflows/cpack.yml
release:
types:
- published
jobs:
package:
runs-on: ubuntu-20.04
# optionally override entire container image:tag string
container: ${{ matrix.distro.container || format('{0}:{1}', matrix.distro.name, matrix.distro.version) }}
# only override container image name and tag is distro version
#container: ${{ matrix.distro.container || matrix.distro.name }}:${{ matrix.distro.version }}
strategy:
fail-fast: false
matrix:
arch:
- cmake: ci-linux-x64 # selects cmake preset
rpm: x86_64 # yum $basearch
deb: amd64 # dpkg --print-architecture
- cmake: ci-linux-arm
rpm: armhfp
deb: armhf
- cmake: ci-linux-arm64
rpm: aarch64
deb: arm64
distro:
- name: ubuntu
version: "22.04"
release_name: jammy
type: deb
- name: ubuntu
version: "20.04"
release_name: focal
type: deb
- name: ubuntu
version: "18.04"
release_name: bionic
type: deb
- name: ubuntu
version: "16.04"
release_name: xenial
type: deb
- name: redhat
version: "7"
release_name: ${{ null }}
type: rpm
container: docker.io/library/centos:7
- name: redhat
version: "8"
release_name: ${{ null }}
type: rpm
container: docker.io/library/rockylinux:8
- name: redhat
version: "9"
release_name: ${{ null }}
type: rpm
container: docker.io/library/rockylinux:9
exclude:
- distro:
name: ubuntu
release_name: xenial
arch:
cmake: ci-linux-arm
- distro:
name: ubuntu
release_name: xenial
arch:
cmake: ci-linux-arm64
- distro:
name: ubuntu
release_name: bionic
arch:
cmake: ci-linux-arm
- distro:
name: redhat
arch:
cmake: ci-linux-arm
- distro:
name: redhat
arch:
cmake: ci-linux-arm64
steps:
# only focal-20.04 has >= 2.18, which is required by actions/checkout to clone
# which enables cmake version discovery
- name: install contemporary Git in runner container if Ubuntu
if: ${{ matrix.distro.name == 'ubuntu' }}
run: |
apt -y update
apt-get -y install software-properties-common
add-apt-repository -y ppa:git-core/ppa
apt -y update
apt -y install git
git --version
- name: install contemporary Git in runner container if RedHat 8 or 9
if: ${{ matrix.distro.name == 'redhat' && (matrix.distro.version == '8' || matrix.distro.version == '9') }}
run: |
dnf -y update
dnf -y install git
git --version
- name: install contemporary Git in runner container if RedHat 7
if: ${{ matrix.distro.name == 'redhat' && matrix.distro.version == '7' }}
run: |
yum -y update
yum -y install centos-release-scl
yum -y install rh-git218
source scl_source enable rh-git218 && git --version
cat << 'EOF' >| /root/git.sh
#!/bin/bash
source scl_source enable rh-git218 && git "${@}"
EOF
chmod +x /root/git.sh
update-alternatives --install /usr/bin/git git /root/git.sh 50
- name: checkout workspace
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: configure build action for distro version
env:
DISTRO_LABEL: ${{ format('{0}-{1}', matrix.distro.name, matrix.distro.version) }}
shell: bash
run: |
mv -v ./.github/actions/openziti-tunnel-build-action/${DISTRO_LABEL}/* ./.github/actions/openziti-tunnel-build-action/
# entrypoint.sh uses the value of arch to select the cmake preset
- name: build binary and package
uses: ./.github/actions/openziti-tunnel-build-action
with:
arch: ${{ matrix.arch.cmake }}
config: Release
- name: list build artifacts
run: |
cat /etc/*-release
ls -horAS ./build/
- name: list program artifacts
run: |
cat /etc/*-release
ls -horAS ./build/programs/ziti-edge-tunnel/
- name: install package artifact in runner container if Ubuntu x86_64
if: ${{ matrix.arch.cmake == 'ci-linux-x64' && matrix.distro.name == 'ubuntu' }}
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt -y install ./build/ziti-edge-tunnel-*.deb
- name: install package artifact in runner container if RedHat
if: ${{ matrix.arch.cmake == 'ci-linux-x64' && matrix.distro.name == 'redhat' }}
run: |
set -x
yum -y install ./build/ziti-edge-tunnel-*.rpm
- name: run binary artifact
if: ${{ matrix.arch.cmake == 'ci-linux-x64' }}
run: |
set -x
cat /etc/*-release
ldd ./build/programs/ziti-edge-tunnel/Release/ziti-edge-tunnel
./build/programs/ziti-edge-tunnel/Release/ziti-edge-tunnel version --verbose
- name: upload package artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.distro.name }}-${{ matrix.distro.version }}-${{ matrix.arch.rpm }}-${{ matrix.distro.type }}
path: ./build/ziti-edge-tunnel-*.${{ matrix.distro.type }}
if-no-files-found: error
- name: Configure jFrog CLI
if: ${{ github.event.release.published && startsWith(github.ref, 'refs/tags/v') }}
uses: jfrog/setup-jfrog-cli@v3
env:
JF_ENV_1: ${{ secrets.ZITI_ARTIFACTORY_CLI_CONFIG_PACKAGE_UPLOAD }}
- name: Upload RPM to Artifactory with jFrog CLI
if: ${{ github.event.release.published && startsWith(github.ref, 'refs/tags/v') && matrix.distro.name == 'redhat' }}
run: >
jf rt upload
./build/ziti-edge-tunnel-*.${{ matrix.distro.type }}
/zitipax-openziti-rpm-stable/redhat${{ matrix.distro.version }}/${{ matrix.arch.rpm }}/
--recursive=false
--flat=true
- name: Upload DEB to Artifactory with jFrog CLI
if: ${{ github.event.release.published && startsWith(github.ref, 'refs/tags/v') && matrix.distro.name == 'ubuntu' }}
run: >
jf rt upload
./build/ziti-edge-tunnel-*.${{ matrix.distro.type }}
/zitipax-openziti-deb-stable/pool/ziti-edge-tunnel/${{ matrix.distro.release_name }}/${{ matrix.arch.deb }}/
--deb=${{ matrix.distro.release_name }}/main/${{ matrix.arch.deb }}
--recursive=false
--flat=true