Fixes: #1602 - add TCP adaptor mapping version (#1603) #43
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Licensed to the Apache Software Foundation (ASF) under one | |
# or more contributor license agreements. See the NOTICE file | |
# distributed with this work for additional information | |
# regarding copyright ownership. The ASF licenses this file | |
# to you under the Apache License, Version 2.0 (the | |
# "License"); you may not use this file except in compliance | |
# with the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, | |
# software distributed under the License is distributed on an | |
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
# KIND, either express or implied. See the License for the | |
# specific language governing permissions and limitations | |
# under the License. | |
# | |
name: Release skupper-router | |
on: | |
push: | |
# Sequence of patterns matched against tags | |
# Right now, we run this job automatically when a semantically versioned | |
# tag is pushed. | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
build-image-amd64: | |
name: Build and publish skupper-router amd64 image | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get the tag name and set it as the CONTAINER_TAG env variable. | |
run: | | |
echo "CONTAINER_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | |
- name: Build and publish skupper-router image | |
run: | | |
export PROJECT_TAG="${{ env.CONTAINER_TAG }}" | |
export VERSION="${{ env.CONTAINER_TAG }}" | |
export BUILD_NUMBER=$((`curl -s https://quay.io/api/v1/repository/skupper/skupper-router/tag/?filter_tag_name=like:${VERSION} | jq '.tags[] | select(has("end_ts") | not) | .name' | grep -E "\"${VERSION}-[0-9]+\"" | wc -l || echo 0` + 1)) | |
echo "BUILD_NUMBER=${BUILD_NUMBER}" >> $GITHUB_ENV | |
# Verify if build number is unique, otherwise fail | |
curl -s "https://quay.io/api/v1/repository/skupper/skupper-router/tag/?filter_tag_name=eq:${VERSION}-${BUILD_NUMBER}" | \ | |
jq .tags | grep -E '^\[\]$' || \ | |
{ echo Unable to get a unique build number ; exit 1 ; } | |
# This is a release build which means we need to push the :latest tag | |
# to the container repo. | |
export PUSH_LATEST=true | |
export PLATFORM=amd64 | |
./.github/scripts/image.sh | |
env: | |
CONTAINER_USER: '${{ secrets.DOCKER_USER }}' | |
CONTAINER_PASSWORD: '${{ secrets.DOCKER_PASSWORD }}' | |
build-image-arm64: | |
name: Build and publish skupper-router arm64 image | |
runs-on: self-hosted-arm64 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get the tag name and set it as the CONTAINER_TAG env variable. | |
run: | | |
echo "CONTAINER_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | |
- name: Build and publish skupper-router arm64 image | |
run: | | |
export VERSION="${{ env.CONTAINER_TAG }}" | |
export BUILD_NUMBER=$((`curl -s https://quay.io/api/v1/repository/skupper/skupper-router/tag/?filter_tag_name=like:${VERSION} | jq '.tags[] | select(has("end_ts") | not) | .name' | grep -E "\"${VERSION}-[0-9]+\"" | wc -l || echo 0` + 1)) | |
export PROJECT_TAG="${{ env.CONTAINER_TAG }}" | |
# This is a release build which means we need to push the :latest tag to the container repo. | |
export PUSH_LATEST=true | |
export PLATFORM=arm64 | |
./.github/scripts/image.sh | |
env: | |
CONTAINER_USER: '${{ secrets.DOCKER_USER }}' | |
CONTAINER_PASSWORD: '${{ secrets.DOCKER_PASSWORD }}' | |
# This job pulls the images produced by the build-image-amd64 and build-image-arm64 jobs | |
create-manifest: | |
name: Pull skupper-router amd64 and arm64 images and create/push manifest | |
needs: [build-image-amd64, build-image-arm64] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install podman | |
run: | | |
sudo mkdir -p /etc/apt/keyrings | |
curl -fsSL https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_$(lsb_release -rs)/Release.key \ | |
| gpg --dearmor \ | |
| sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null | |
echo \ | |
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg]\ | |
https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_$(lsb_release -rs)/ /" \ | |
| sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null | |
sudo apt-get update -qq | |
sudo apt-get -qq -y install podman | |
podman version | |
# temporary fix for https://github.com/containers/podman/issues/21024 | |
wget https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_22.04/amd64/conmon_2.1.2~0_amd64.deb -O /tmp/conmon_2.1.2.deb | |
sudo apt install /tmp/conmon_2.1.2.deb | |
# Starting systemd user service | |
systemctl --user start podman.socket | |
- name: Get the tag name and set it as the CONTAINER_TAG env variable. | |
run: | | |
echo "CONTAINER_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | |
- name: Pull skupper-router amd64 and arm64 images and create/push manifest | |
run: | | |
export VERSION="${CONTAINER_TAG}" | |
export BUILD_NUMBER=$((`curl -s https://quay.io/api/v1/repository/skupper/skupper-router/tag/?filter_tag_name=like:${VERSION} | jq '.tags[] | select(has("end_ts") | not) | .name' | grep -E "\"${VERSION}-[0-9]+\"" | wc -l || echo 0` + 1)) | |
export PROJECT_TAG="${{ env.CONTAINER_TAG }}" | |
# This is a release candidate build which means we WON'T push the :latest tag to the container repo. | |
export PUSH_LATEST=true | |
./.github/scripts/manifest.sh | |
env: | |
CONTAINER_USER: '${{ secrets.DOCKER_USER }}' | |
CONTAINER_PASSWORD: '${{ secrets.DOCKER_PASSWORD }}' | |
create-release: | |
name: Create Draft Release | |
needs: create-manifest | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get the tag name and set it as the CONTAINER_TAG env variable. | |
run: | | |
echo "CONTAINER_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | |
- name: Get the build number | |
run: | | |
export VERSION="${CONTAINER_TAG}" | |
export BUILD_NUMBER=$((`curl -s https://quay.io/api/v1/repository/skupper/skupper-router/tag/?filter_tag_name=like:${VERSION} | jq '.tags[] | select(has("end_ts") | not) | .name' | grep -E "\"${VERSION}-[0-9]+\"" | wc -l`)) | |
echo "BUILD_NUMER(create-release)=${BUILD_NUMBER}" | |
echo "BUILD_NUMBER=${BUILD_NUMBER}" >> $GITHUB_ENV | |
# Now that we have successfully pushed a tagged version of the skupper-router container | |
# we will create a draft release and add as much information to it as possible. | |
- name: Create Draft Release | |
if: env.BUILD_NUMBER == '1' | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ env.CONTAINER_TAG }} | |
body: | | |
The skupper-router is available as an image: | |
- quay.io/skupper/skupper-router:${{ env.CONTAINER_TAG }} | |
Issues fixed in this release | |
- https://github.com/skupperproject/skupper-router/issues?q=is:issue%20milestone:${{ env.CONTAINER_TAG }} | |
draft: true |