Skip to content

Bump version to 16.5.0 #112

Bump version to 16.5.0

Bump version to 16.5.0 #112

Workflow file for this run

name: build
on:
push:
paths-ignore:
- README*.md
branches-ignore:
# The autobump** branches will be triggered in the pull request,
# so there is no need to trigger it when pushing.
- autobump**
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- RELEASE_PACKAGE: gitlab-ce
RELEASE_VERSION: 16.5.0-ce.0
PUSH_TAGS: 16.5.0-ce.0,16.5.0-ce,16.5-ce,16-ce,ce,latest
- RELEASE_PACKAGE: gitlab-ee
RELEASE_VERSION: 16.5.0-ee.0
PUSH_TAGS: 16.5.0-ee.0,16.5.0-ee,16.5-ee,16-ee,ee
steps:
- uses: actions/checkout@v3
- name: docker login to docker.io
uses: docker/login-action@v2
# Only builds on the main branch will trigger the push, and forked repositories are excluded
if: github.repository_owner == 'zengxs' && github.ref == 'refs/heads/main'
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Setup binfmt-support
uses: docker/setup-qemu-action@v2
- name: Setup docker buildx
uses: docker/setup-buildx-action@v2
# Generate the push tags for multi-arch manifest
- name: Generate tags
id: generate-tags
run: |
push_tags=$(echo ${{ matrix.PUSH_TAGS }} | tr ',' '\n' | xargs -I {} echo "docker.io/${{ secrets.DOCKERHUB_USERNAME }}/gitlab:{}" | tr '\n' ',')
echo "push_tags=${push_tags}" >> $GITHUB_ENV
# Generate the push tags for arm64 image (add '-arm64' suffix to the push tags)
- name: Generate ARM64 tags
id: generate-arm64-tags
run: |
push_arm64_tags=$(echo ${{ env.push_tags }} | tr ',' '\n' | xargs -I {} echo "{}-arm64" | tr '\n' ',')
echo "push_arm64_tags=${push_arm64_tags}" >> $GITHUB_ENV
- name: Build and push ARM64 image
uses: docker/build-push-action@v3
with:
context: .
# Only builds on the main branch will trigger the push, and forked repositories are excluded
push: ${{ github.repository_owner == 'zengxs' && github.ref == 'refs/heads/main' }}
tags: ${{ env.push_arm64_tags }}
platforms: linux/arm64
build-args: |
RELEASE_PACKAGE=${{ matrix.RELEASE_PACKAGE }}
RELEASE_VERSION=${{ matrix.RELEASE_VERSION }}
# Create multi-arch manifest (x86-64 reuses official image, arm64 uses the image built in the previous step)
- name: Docker multi-arch manifest
# Only builds on the main branch will trigger the push, and forked repositories are excluded
if: github.repository_owner == 'zengxs' && github.ref == 'refs/heads/main'
shell: python
env:
RELEASE_PACKAGE: ${{ matrix.RELEASE_PACKAGE }}
RELEASE_VERSION: ${{ matrix.RELEASE_VERSION }}
run: |
import os
RELEASE_PACKAGE = os.environ['RELEASE_PACKAGE']
RELEASE_VERSION = os.environ['RELEASE_VERSION']
push_tags = os.environ['push_tags'].split(',')
push_tags = [tag for tag in push_tags if tag != '']
def run_command(cmd):
print(f'RUN: {cmd}')
os.system(cmd)
for tag in push_tags:
print(f'Creating multi-arch manifest for {tag}')
run_command(f'docker manifest create {tag} --amend {tag}-arm64 --amend docker.io/gitlab/{RELEASE_PACKAGE}:{RELEASE_VERSION}')
run_command(f'docker manifest push --purge {tag}')