Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

[SYSE-304]: Update release engineering code to be manageable by gromit templates #236

[SYSE-304]: Update release engineering code to be manageable by gromit templates

[SYSE-304]: Update release engineering code to be manageable by gromit templates #236

Workflow file for this run

# Generated by: tyk-ci/wf-gen
# Generated on: Thu Sep 23 14:04:36 UTC 2021
# Generation commands:
# ./pr.zsh -repos tyk-sync -title releng: latest releng -branch releng/updates
# m4 -E -DxREPO=tyk-sync
# Distribution channels covered by this workflow
# - Ubuntu and Debian
# - RHEL/OL
# - tarballs
# - docker hub
# - devenv ECR
# - AWS mktplace
# - Cloudsmith
name: Release
on:
pull_request:
push:
branches:
- master
- release-**
tags:
- 'v*'
jobs:
goreleaser:
runs-on: ubuntu-latest
container: tykio/golang-cross:1.19-bullseye
env:
debvers: 'ubuntu/bionic ubuntu/focal ubuntu/jammy debian/bullseye debian/bookworm'
rpmvers: 'el/8 el/9 amazon/2023'
outputs:
tag: ${{ steps.targets.outputs.tag }}
steps:
- name: Checkout of tyk-sync
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set git dafe.directory
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: startsWith(github.ref, 'refs/tags')
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to Cloudsmith
if: startsWith(github.ref, 'refs/tags')
uses: docker/login-action@v3
with:
registry: docker.tyk.io
username: ${{ secrets.CLOUDSMITH_USERNAME }}
password: ${{ secrets.CLOUDSMITH_API_KEY }}
- name: Unlock agent and set targets
id: targets
shell: bash
env:
NFPM_STD_PASSPHRASE: ${{ secrets.SIGNING_KEY_PASSPHRASE }}
GPG_FINGERPRINT: 12B5D62C28F57592D1575BD51ED14C59E37DAC20
PKG_SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
run: |
ci/bin/unlock-agent.sh
- uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean -f ${{ matrix.goreleaser }} ${{ !startsWith(github.ref, 'refs/tags/') && ' --snapshot' || '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CGO_ENABLED: 0
NFPM_STD_PASSPHRASE: ${{ secrets.SIGNING_KEY_PASSPHRASE }}
NFPM_PAYG_PASSPHRASE: ${{ secrets.SIGNING_KEY_PASSPHRASE }}
GPG_FINGERPRINT: 12B5D62C28F57592D1575BD51ED14C59E37DAC20
PKG_SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
RPMVERS: ${{ env.debvers }}
DEBVERS: ${{ env.rpmvers }}
- uses: actions/upload-artifact@v3
with:
name: deb
retention-days: 1
path: |
dist/*.deb
- uses: actions/upload-artifact@v3
with:
name: rpm
retention-days: 1
path: |
dist/*.rpm
- uses: actions/upload-artifact@v3
with:
name: payg
retention-days: 1
path: dist/*PAYG*
upgrade-deb:
runs-on: ubuntu-latest
needs: goreleaser
strategy:
fail-fast: false
matrix:
arch:
- amd64
- arm64
distro:
- ubuntu:bionic
- ubuntu:focal
- ubuntu:jammy
- debian:bullseye
- debian:bookworm
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/download-artifact@v3
with:
name: deb
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v3
- name: generate dockerfile
run: |
echo 'FROM ${{ matrix.distro }}
ARG TARGETARCH
COPY tyk-sync*_${TARGETARCH}.deb /tyk-sync.deb
RUN apt-get update && apt-get install -y curl
RUN curl -fsSL https://packagecloud.io/install/repositories/tyk/tyk-sync/script.deb.sh | bash && apt-get install -y tyk-sync=1.2.0
RUN dpkg -i /tyk-sync.deb' > Dockerfile
- name: install on ${{ matrix.distro }}
uses: docker/build-push-action@v5
with:
context: "."
platforms: linux/${{ matrix.arch }}
file: Dockerfile
push: false
upgrade-rpm:
needs: goreleaser
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
distro:
- amazonlinux:2023
- registry.access.redhat.com/ubi8/ubi
- registry.access.redhat.com/ubi9/ubi
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/download-artifact@v3
with:
name: rpm
- uses: docker/setup-buildx-action@v3
- name: generate dockerfile
run: |
echo 'FROM registry.access.redhat.com/${{ matrix.distro }}
COPY tyk-sync*_x86_64.rpm /tyk-sync.rpm
RUN yum install -y curl
RUN curl -s https://packagecloud.io/install/repositories/tyk/tyk-sync/script.rpm.sh | bash && yum install -y tyk-sync-1.2.0-1
RUN rpm -Uvh /tyk-sync.rpm' > Dockerfile
- name: install on ${{ matrix.distro }}
uses: docker/build-push-action@v5
with:
context: "."
file: Dockerfile
push: false