Skip to content

Commit 4e0c25e

Browse files
author
Gromit
committed
Auto generated from templates by gromit
1 parent 94f4aa1 commit 4e0c25e

File tree

3 files changed

+92
-51
lines changed

3 files changed

+92
-51
lines changed

.github/workflows/release.yml

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on:
2424
- 'v*'
2525
env:
2626
GOPRIVATE: github.com/TykTechnologies
27-
VARIATION: inverted
27+
VARIATION: prod-variation
2828
DOCKER_BUILD_SUMMARY: false
2929
DOCKER_BUILD_RECORD_UPLOAD: false
3030
# startsWith covers pull_request_target too
@@ -47,9 +47,9 @@ jobs:
4747
goreleaser: 'ci/goreleaser/goreleaser.yml'
4848
cgo: 1
4949
rpmvers: 'el/7 el/8 el/9 amazon/2 amazon/2023'
50-
debvers: 'ubuntu/xenial ubuntu/bionic ubuntu/focal ubuntu/jammy debian/jessie debian/buster debian/bullseye debian/bookworm'
50+
debvers: 'ubuntu/xenial ubuntu/bionic ubuntu/focal ubuntu/jammy ubuntu/noble debian/jessie debian/buster debian/bullseye debian/bookworm debian/trixie'
5151
outputs:
52-
tags: ${{ steps.ci_metadata.outputs.tags }}
52+
std_tags: ${{ steps.ci_metadata_std.outputs.tags }}
5353
commit_author: ${{ steps.set_outputs.outputs.commit_author}}
5454
steps:
5555
- name: Checkout of tyk
@@ -145,12 +145,13 @@ jobs:
145145
if: ${{ matrix.golang_cross == '1.16' }}
146146
with:
147147
mask-password: 'true'
148-
- name: Docker metadata for CI
149-
id: ci_metadata
148+
- name: Docker metadata for std CI
149+
id: ci_metadata_std
150150
if: ${{ matrix.golang_cross == '1.16' }}
151151
uses: docker/metadata-action@v5
152152
with:
153-
images: ${{ steps.ecr.outputs.registry }}/tyk
153+
images: |
154+
${{ steps.ecr.outputs.registry }}/tyk
154155
flavor: |
155156
latest=false
156157
tags: |
@@ -160,48 +161,57 @@ jobs:
160161
type=semver,pattern={{major}},prefix=v
161162
type=semver,pattern={{major}}.{{minor}},prefix=v
162163
type=semver,pattern={{version}},prefix=v
163-
- name: push image to CI
164+
- name: push std image to CI
164165
if: ${{ matrix.golang_cross == '1.16' }}
165166
uses: docker/build-push-action@v6
166167
with:
167168
context: "dist"
168-
platforms: linux/amd64,linux/arm64
169+
platforms: linux/amd64,linux/arm64,linux/s390x
169170
file: ci/Dockerfile.std
170171
provenance: mode=max
171172
sbom: true
172173
push: true
173174
cache-from: type=gha
174175
cache-to: type=gha,mode=max
175-
tags: ${{ steps.ci_metadata.outputs.tags }}
176-
labels: ${{ steps.tag_metadata.outputs.labels }}
176+
tags: ${{ steps.ci_metadata_std.outputs.tags }}
177+
labels: ${{ steps.ci_metadata_std.outputs.labels }}
178+
build-args: |
179+
BUILD_PACKAGE_NAME=tyk-gateway
177180
- name: Docker metadata for tag push
178-
id: tag_metadata
181+
id: tag_metadata_std
179182
uses: docker/metadata-action@v5
180183
with:
181184
images: |
182-
tykio/tyk-gateway
183185
docker.tyk.io/tyk-gateway/tyk-gateway
186+
187+
tykio/tyk-gateway
184188
flavor: |
185189
latest=false
186190
prefix=v
187191
tags: |
188192
type=semver,pattern={{major}}.{{minor}}
189193
type=semver,pattern={{version}}
190-
labels: "org.opencontainers.image.title=tyk-gateway \norg.opencontainers.image.description=Tyk Open Source API Gateway written in Go, supporting REST, GraphQL, TCP and gRPC protocols\norg.opencontainers.image.vendor=tyk.io\norg.opencontainers.image.version=${{ github.ref_name }}\n"
191-
- name: push image to prod
194+
labels: |
195+
org.opencontainers.image.title=Tyk Gateway
196+
org.opencontainers.image.description=Tyk Open Source API Gateway written in Go, supporting REST, GraphQL, TCP and gRPC protocols
197+
org.opencontainers.image.vendor=tyk.io
198+
org.opencontainers.image.version=${{ github.ref_name }}
199+
- name: push std image to prod
192200
if: ${{ matrix.golang_cross == '1.16' }}
193201
uses: docker/build-push-action@v6
194202
with:
195203
context: "dist"
196-
platforms: linux/amd64,linux/arm64
204+
platforms: linux/amd64,linux/arm64,linux/s390x
197205
file: ci/Dockerfile.std
198206
provenance: mode=max
199207
sbom: true
200208
cache-from: type=gha
201209
cache-to: type=gha,mode=max
202210
push: ${{ startsWith(github.ref, 'refs/tags') }}
203-
tags: ${{ steps.tag_metadata.outputs.tags }}
204-
labels: ${{ steps.tag_metadata.outputs.labels }}
211+
tags: ${{ steps.tag_metadata_std.outputs.tags }}
212+
labels: ${{ steps.tag_metadata_std.outputs.labels }}
213+
build-args: |
214+
BUILD_PACKAGE_NAME=tyk-gateway
205215
- name: save deb
206216
uses: actions/upload-artifact@v4
207217
if: ${{ matrix.golang_cross == '1.16' }}
@@ -285,7 +295,7 @@ jobs:
285295
env:
286296
GH_TOKEN: ${{ github.token }}
287297
run: |
288-
gh release download --repo github.com/tyklabs/tyk-pro --archive tar.gz -O env.tgz
298+
gh release download --repo github.com/TykTechnologies/tyk-pro --archive tar.gz -O env.tgz
289299
mkdir auto && tar --strip-components=1 -C auto -xzvf env.tgz
290300
- name: env up
291301
shell: bash
@@ -298,10 +308,11 @@ jobs:
298308
TYK_MDCB_LICENSE: ${{ secrets.MDCB_LICENSE }}
299309
run: |
300310
match_tag=${{steps.ecr.outputs.registry}}/tyk:$BASE_REF
301-
tags=(${{ needs.goreleaser.outputs.tags }})
311+
tags=(${{ needs.goreleaser.outputs.std_tags }})
302312
set -eaxo pipefail
303313
docker run -q --rm -v ~/.docker/config.json:/root/.docker/config.json tykio/gromit policy match ${tags[0]} ${match_tag} 2>versions.env
304314
echo '# alfa and beta have to come after the override
315+
305316
tyk_alfa_image=$tyk_image
306317
tyk_beta_image=$tyk_image
307318
ECR=${{steps.ecr.outputs.registry}}
@@ -359,7 +370,7 @@ jobs:
359370
- uses: actions/setup-python@v5
360371
with:
361372
cache: 'pip'
362-
python-version: '3.11'
373+
python-version: '3.10'
363374
- name: Run API tests
364375
id: test_execution
365376
working-directory: tyk-analytics/tests/api
@@ -503,9 +514,11 @@ jobs:
503514
load: true
504515
- name: Test the built container image with api functionality test.
505516
run: |
506-
docker run -d -p8080:8080 --network ${{ job.container.network }} --rm test-${{ matrix.distro }}-${{ matrix.arch }}
517+
docker run -d -p8080:8080 --name=test --platform linux/${{ matrix.arch }} --network ${{ job.container.network }} --rm test-${{ matrix.distro }}-${{ matrix.arch }}
507518
sleep 2
508519
./ci/tests/api-functionality/api_test.sh
520+
sleep 2
521+
docker stop test || true
509522
upgrade-rpm:
510523
services:
511524
httpbin.org:
@@ -560,7 +573,7 @@ jobs:
560573
tags: test-${{ matrix.distro }}-${{ matrix.arch }}
561574
load: true
562575
- name: Test the built container image with api functionality test.
563-
run: "docker run -d -p8080:8080 --network ${{ job.container.network }} --rm test-${{ matrix.distro }}-${{ matrix.arch }}\nsleep 2\n./ci/tests/api-functionality/api_test.sh \n"
576+
run: "docker run -d -p8080:8080 --name=test --platform linux/${{ matrix.arch }} --network ${{ job.container.network }} --rm test-${{ matrix.distro }}-${{ matrix.arch }}\nsleep 2\n./ci/tests/api-functionality/api_test.sh\nsleep 2\ndocker stop test || true \n"
564577
sbom:
565578
needs: goreleaser
566579
uses: TykTechnologies/github-actions/.github/workflows/sbom.yaml@main

ci/Dockerfile.std

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Generated by: gromit policy
22

3-
FROM debian:bookworm-slim
3+
FROM debian:trixie-slim
44
ARG TARGETARCH
5+
ARG BUILD_PACKAGE_NAME
56

67
ENV DEBIAN_FRONTEND=noninteractive
78

@@ -22,8 +23,8 @@ RUN rm -rf /root/.cache \
2223
&& find /usr/lib -type f -name '*.a' -o -name '*.o' -delete
2324

2425
# Comment this to test in dev
25-
COPY *${TARGETARCH}.deb /
26-
RUN rm -f /*fips*.deb && dpkg -i /tyk-gateway*${TARGETARCH}.deb && rm /*.deb
26+
COPY ${BUILD_PACKAGE_NAME}_*${TARGETARCH}.deb /
27+
RUN dpkg -i /${BUILD_PACKAGE_NAME}*${TARGETARCH}.deb && rm /*.deb
2728

2829
ARG PORTS
2930

ci/goreleaser/goreleaser.yml

Lines changed: 53 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
# This project needs CGO_ENABLED=1 and the cross-compiler toolchains for
55
# - arm64
66
# - amd64
7-
7+
version: 2
88
builds:
9-
- id: std
9+
- id: fips-amd64
1010
flags:
11-
- -tags=ignore
12-
- -trimpath
13-
- -tags=goplugin
11+
- -tags=goplugin,fips,boringcrypto
12+
env:
13+
- NOP=nop # ignore this, it is jsut to avoid a complex conditional in the templates
14+
- CC=gcc
15+
- $env
1416
ldflags:
1517
- -X github.com/TykTechnologies/tyk/internal/build.Version={{.Version}}
1618
- -X github.com/TykTechnologies/tyk/internal/build.Commit={{.FullCommit}}
@@ -21,14 +23,13 @@ builds:
2123
goarch:
2224
- amd64
2325
binary: tyk
24-
- id: fips
26+
- id: std-amd64
2527
flags:
26-
- -tags=ignore
27-
- -trimpath
2828
- -tags=goplugin
29-
- -tags=fips,boringcrypto
29+
- -trimpath
3030
env:
31-
- GOEXPERIMENT=boringcrypto
31+
- NOP=nop # ignore this, it is jsut to avoid a complex conditional in the templates
32+
- CC=gcc
3233
ldflags:
3334
- -X github.com/TykTechnologies/tyk/internal/build.Version={{.Version}}
3435
- -X github.com/TykTechnologies/tyk/internal/build.Commit={{.FullCommit}}
@@ -41,32 +42,48 @@ builds:
4142
binary: tyk
4243
- id: std-arm64
4344
flags:
44-
- -tags=ignore
45-
- -trimpath
4645
- -tags=goplugin
46+
- -trimpath
47+
env:
48+
- NOP=nop # ignore this, it is jsut to avoid a complex conditional in the templates
49+
- CC=aarch64-linux-gnu-gcc
4750
ldflags:
4851
- -X github.com/TykTechnologies/tyk/internal/build.Version={{.Version}}
4952
- -X github.com/TykTechnologies/tyk/internal/build.Commit={{.FullCommit}}
5053
- -X github.com/TykTechnologies/tyk/internal/build.BuildDate={{.Date}}
5154
- -X github.com/TykTechnologies/tyk/internal/build.BuiltBy=goreleaser
52-
env:
53-
- CC=aarch64-linux-gnu-gcc
5455
goos:
5556
- linux
5657
goarch:
5758
- arm64
5859
binary: tyk
60+
- id: std-s390x
61+
flags:
62+
- -tags=goplugin
63+
- -trimpath
64+
env:
65+
- NOP=nop # ignore this, it is jsut to avoid a complex conditional in the templates
66+
- CC=s390x-linux-gnu-gcc
67+
ldflags:
68+
- -X github.com/TykTechnologies/tyk/internal/build.Version={{.Version}}
69+
- -X github.com/TykTechnologies/tyk/internal/build.Commit={{.FullCommit}}
70+
- -X github.com/TykTechnologies/tyk/internal/build.BuildDate={{.Date}}
71+
- -X github.com/TykTechnologies/tyk/internal/build.BuiltBy=goreleaser
72+
goos:
73+
- linux
74+
goarch:
75+
- s390x
76+
binary: tyk
5977
nfpms:
60-
- id: std
78+
- id: fips
6179
vendor: "Tyk Technologies Ltd"
6280
homepage: "https://tyk.io"
6381
maintainer: "Tyk <info@tyk.io>"
64-
description: Tyk Open Source API Gateway written in Go, supporting REST, GraphQL, TCP and gRPC protocols
65-
package_name: tyk-gateway
82+
description: Tyk Open Source API Gateway written in Go, supporting REST, GraphQL, TCP and gRPC protocols Built with boringssl
83+
package_name: tyk-gateway-fips
6684
file_name_template: "{{ .ConventionalFileName }}"
67-
builds:
68-
- std
69-
- std-arm64
85+
ids:
86+
- fips-amd64
7087
formats:
7188
- deb
7289
- rpm
@@ -115,15 +132,17 @@ nfpms:
115132
signature:
116133
key_file: tyk.io.signing.key
117134
type: origin
118-
- id: fips
135+
- id: std
119136
vendor: "Tyk Technologies Ltd"
120137
homepage: "https://tyk.io"
121138
maintainer: "Tyk <info@tyk.io>"
122139
description: Tyk Open Source API Gateway written in Go, supporting REST, GraphQL, TCP and gRPC protocols
123-
package_name: tyk-gateway-fips
140+
package_name: tyk-gateway
124141
file_name_template: "{{ .ConventionalFileName }}"
125-
builds:
126-
- fips
142+
ids:
143+
- std-amd64
144+
- std-arm64
145+
- std-s390x
127146
formats:
128147
- deb
129148
- rpm
@@ -173,13 +192,21 @@ nfpms:
173192
key_file: tyk.io.signing.key
174193
type: origin
175194
publishers:
176-
- name: tyk-gateway-unstable
195+
- name: fips
196+
ids:
197+
- fips
198+
env:
199+
- PACKAGECLOUD_TOKEN={{ .Env.PACKAGECLOUD_TOKEN }}
200+
cmd: packagecloud publish --debvers "{{ .Env.DEBVERS }}" --rpmvers "{{ .Env.RPMVERS }}" tyk/tyk-ee-unstable {{ .ArtifactPath }}
201+
- name: std
202+
ids:
203+
- std
177204
env:
178205
- PACKAGECLOUD_TOKEN={{ .Env.PACKAGECLOUD_TOKEN }}
179206
cmd: packagecloud publish --debvers "{{ .Env.DEBVERS }}" --rpmvers "{{ .Env.RPMVERS }}" tyk/tyk-gateway-unstable {{ .ArtifactPath }}
180207
# This disables archives
181208
archives:
182-
- format: binary
209+
- formats: ['binary']
183210
allow_different_binary_count: true
184211
checksum:
185212
disable: true

0 commit comments

Comments
 (0)