-
Notifications
You must be signed in to change notification settings - Fork 728
232 lines (201 loc) · 6.87 KB
/
release-final.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
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
name: Finalize release
on:
release:
types: [published]
jobs:
push-final-images:
runs-on: ubuntu-latest
env:
SYSDIG_IMAGE_BASE: ghcr.io/draios/sysdig
SYSDIG_DOCKERHUB_IMAGE_BASE: docker.io/sysdig/sysdig
RELEASE: ${{ github.event.release.name }}
steps:
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Login to Github Packages
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish final docker images
uses: akhilerm/[email protected]
with:
src: ${{ env.SYSDIG_IMAGE_BASE }}:${{ env.RELEASE }}-draft
dst: |
${{ env.SYSDIG_IMAGE_BASE }}:${{ env.RELEASE }}
${{ env.SYSDIG_IMAGE_BASE }}:latest
${{ env.SYSDIG_DOCKERHUB_IMAGE_BASE }}:${{ env.RELEASE }}
${{ env.SYSDIG_DOCKERHUB_IMAGE_BASE }}:latest
release-rpm:
strategy:
matrix:
name: [amd64, arm64]
include:
- name: amd64
base_arch: x86_64
release_arch: x86_64
- name: arm64
base_arch: aarch64
release_arch: aarch64
runs-on: ubuntu-latest
env:
RPM_BASEARCH: ${{ matrix.base_arch }}
RELEASE_ARCH: ${{ matrix.release_arch }}
REPOSITORY_NAME: stable
REPOSITORY_DIR: rpm_repo
PACKAGES_DIR: packages
S3_BUCKET: download.draios.com
RELEASE: ${{ github.event.release.name }}
KEY_ID: EC51E8C4
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
container:
image: centos:7
steps:
- name: Install deps
run: |
yum -y install unzip createrepo_c git
cd /tmp
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
./aws/install
- name: Checkout Sysdig
uses: actions/checkout@v2
with:
path: sysdig
- name: Create directories
run: |
mkdir -p $REPOSITORY_DIR
mkdir -p $PACKAGES_DIR
- name: Download RPM
uses: dsaltares/fetch-gh-release-asset@master
with:
version: "tags/${{ env.RELEASE }}"
file: sysdig-${{ env.RELEASE }}-${{ env.RELEASE_ARCH }}.rpm
target: ${{ env.PACKAGES_DIR }}/sysdig-${{ env.RELEASE }}-${{ env.RELEASE_ARCH }}.rpm
token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@fcd8bb1e0a3c9d2a0687615ee31d34d8aea18a96
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: us-east-1
- name: Import private key
env:
PRIVATE_KEY: ${{ secrets.SYSDIG_REPO_SIGNING_KEY }}
run: printenv PRIVATE_KEY | gpg --import -
- name: Release RPMs
env:
SCRIPTS_DIR: sysdig/scripts/release
run: sysdig/scripts/release/release_rpm.sh
release-deb:
strategy:
matrix:
name: [amd64, arm64]
include:
- name: amd64
base_arch: amd64
release_arch: x86_64
- name: arm64
base_arch: arm64
release_arch: aarch64
runs-on: ubuntu-latest
env:
DEB_BASEARCH: ${{ matrix.base_arch }}
RELEASE_ARCH: ${{ matrix.release_arch }}
REPOSITORY_NAME: stable
REPOSITORY_DIR: deb_repo
PACKAGES_DIR: packages
RELEASE: ${{ github.event.release.name }}
S3_BUCKET: download.draios.com
KEY_ID: EC51E8C4
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
steps:
- name: Install deps
run: |
sudo apt-get update && sudo apt-get -y install dpkg-dev gpg
- name: Checkout Sysdig
uses: actions/checkout@v2
with:
path: sysdig
- name: Create directories
run: |
mkdir -p $REPOSITORY_DIR
mkdir -p $PACKAGES_DIR
- name: Download DEB
uses: dsaltares/fetch-gh-release-asset@master
with:
version: "tags/${{ env.RELEASE }}"
file: sysdig-${{ env.RELEASE }}-${{ env.RELEASE_ARCH }}.deb
target: ${{ env.PACKAGES_DIR }}/sysdig-${{ env.RELEASE }}-${{ env.RELEASE_ARCH }}.deb
token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@fcd8bb1e0a3c9d2a0687615ee31d34d8aea18a96
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: us-east-1
- name: Import private key
env:
PRIVATE_KEY: ${{ secrets.SYSDIG_REPO_SIGNING_KEY }}
run: printenv PRIVATE_KEY | gpg --import -
- name: Release DEBs
env:
SCRIPTS_DIR: sysdig/scripts/release
run: sysdig/scripts/release/release_deb.sh
release-tgz:
strategy:
matrix:
name: [amd64, arm64]
include:
- name: amd64
base_arch: x86_64
release_arch: x86_64
- name: arm64
base_arch: aarch64
release_arch: aarch64
runs-on: ubuntu-latest
env:
RELEASE_ARCH: ${{ matrix.release_arch }}
TGZ_BASEARCH: ${{ matrix.base_arch }}
REPOSITORY_NAME: stable
REPOSITORY_DIR: tgz_repo
PACKAGES_DIR: packages
RELEASE: ${{ github.event.release.name }}
S3_BUCKET: download.draios.com
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
steps:
- name: Checkout Sysdig
uses: actions/checkout@v2
with:
path: sysdig
- name: Create directories
run: |
mkdir -p $REPOSITORY_DIR
mkdir -p $PACKAGES_DIR
- name: Download targz
uses: dsaltares/fetch-gh-release-asset@master
with:
version: "tags/${{ env.RELEASE }}"
file: sysdig-${{ env.RELEASE }}-${{ env.RELEASE_ARCH }}.tar.gz
target: ${{ env.PACKAGES_DIR }}/sysdig-${{ env.RELEASE }}-${{ env.RELEASE_ARCH }}.tar.gz
token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@fcd8bb1e0a3c9d2a0687615ee31d34d8aea18a96
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: us-east-1
- name: Release tar.gz
run: sysdig/scripts/release/release_tgz.sh
- name: Release install-sysdig
run: aws s3 cp sysdig/scripts/install-sysdig s3://${{ env.S3_BUCKET }}/${{ env.REPOSITORY_NAME }}/ --acl public-read