The pinned action versions had drifted apart between the container image repositories, which made it hard to tell whether a workflow failure was caused by a local change or by an outdated action. All actions are now pinned to the commit sha of their latest upstream release, so every repository runs the same toolchain.
174 lines
6.4 KiB
YAML
174 lines
6.4 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "**"
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: "Tag which should be released"
|
|
type: string
|
|
required: true
|
|
|
|
jobs:
|
|
push-arm64:
|
|
runs-on: ubuntu-latest-arm64
|
|
steps:
|
|
- id: version_extraction
|
|
name: Extract git tag
|
|
run: |
|
|
VERSION="${{ inputs.tag || github.ref_name }}"
|
|
VERSION="${VERSION#refs/*/}"
|
|
|
|
echo "Version (raw): ${VERSION}"
|
|
echo "Version (cleaned): ${VERSION/v/}"
|
|
|
|
echo "version_raw=${VERSION}" >> $GITHUB_OUTPUT
|
|
echo "version_cleaned=${VERSION/v/}" >> $GITHUB_OUTPUT
|
|
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
fetch-tags: true
|
|
ref: "${{ steps.version_extraction.outputs.version_raw }}"
|
|
|
|
- uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
|
|
with:
|
|
registry: git.cryptic.systems
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }}
|
|
|
|
- uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
|
|
with:
|
|
registry: harbor.cryptic.systems
|
|
username: ${{ secrets.HARBOR_CRYPTIC_SYSTEMS_USERNAME }}
|
|
password: ${{ secrets.HARBOR_CRYPTIC_SYSTEMS_PASSWORD }}
|
|
|
|
- uses: docker/setup-qemu-action@1f40c72289eff860ee54a304f1438e3cff362e0a # v4.3.0
|
|
with:
|
|
image: harbor.cryptic.systems/docker/tonistiigi/binfmt:latest
|
|
|
|
- uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
|
|
|
|
- name: Build and push image
|
|
run: |
|
|
docker buildx build \
|
|
--build-arg MARKDOWNLINT_VERSION=${{ steps.version_extraction.outputs.version_raw }} \
|
|
--file Dockerfile \
|
|
--platform linux/arm64 \
|
|
--provenance false \
|
|
--push \
|
|
--tag git.cryptic.systems/volker.raschek/markdownlint:${{ steps.version_extraction.outputs.version_cleaned }}-arm64 \
|
|
.
|
|
|
|
push-amd64:
|
|
runs-on: ubuntu-latest-amd64
|
|
steps:
|
|
- id: version_extraction
|
|
name: Extract git tag
|
|
run: |
|
|
VERSION="${{ inputs.tag || github.ref_name }}"
|
|
VERSION="${VERSION#refs/*/}"
|
|
|
|
echo "Version (raw): ${VERSION}"
|
|
echo "Version (cleaned): ${VERSION/v/}"
|
|
|
|
echo "version_raw=${VERSION}" >> $GITHUB_OUTPUT
|
|
echo "version_cleaned=${VERSION/v/}" >> $GITHUB_OUTPUT
|
|
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
fetch-tags: true
|
|
ref: "${{ steps.version_extraction.outputs.version_raw }}"
|
|
|
|
- uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
|
|
with:
|
|
registry: git.cryptic.systems
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }}
|
|
|
|
- uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
|
|
with:
|
|
registry: harbor.cryptic.systems
|
|
username: ${{ secrets.HARBOR_CRYPTIC_SYSTEMS_USERNAME }}
|
|
password: ${{ secrets.HARBOR_CRYPTIC_SYSTEMS_PASSWORD }}
|
|
|
|
- uses: docker/setup-qemu-action@1f40c72289eff860ee54a304f1438e3cff362e0a # v4.3.0
|
|
with:
|
|
image: harbor.cryptic.systems/docker/tonistiigi/binfmt:latest
|
|
|
|
- uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
|
|
|
|
- name: Build and push image
|
|
run: |
|
|
docker buildx build \
|
|
--build-arg MARKDOWNLINT_VERSION=${{ steps.version_extraction.outputs.version_raw }} \
|
|
--file Dockerfile \
|
|
--platform linux/amd64 \
|
|
--provenance false \
|
|
--push \
|
|
--tag git.cryptic.systems/volker.raschek/markdownlint:${{ steps.version_extraction.outputs.version_cleaned }}-amd64 \
|
|
.
|
|
|
|
push-manifest:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- push-arm64
|
|
- push-amd64
|
|
steps:
|
|
- id: version_extraction
|
|
name: Extract git tag
|
|
run: |
|
|
VERSION="${{ inputs.tag || github.ref_name }}"
|
|
VERSION="${VERSION#refs/*/}"
|
|
|
|
echo "Version (raw): ${VERSION}"
|
|
echo "Version (cleaned): ${VERSION/v/}"
|
|
|
|
echo "version_raw=${VERSION}" >> $GITHUB_OUTPUT
|
|
echo "version_cleaned=${VERSION/v/}" >> $GITHUB_OUTPUT
|
|
|
|
- uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
|
|
with:
|
|
registry: git.cryptic.systems
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }}
|
|
|
|
- name: Create and push manifest
|
|
run: |
|
|
docker manifest create git.cryptic.systems/volker.raschek/markdownlint:${{ steps.version_extraction.outputs.version_cleaned }} \
|
|
--amend git.cryptic.systems/volker.raschek/markdownlint:${{ steps.version_extraction.outputs.version_cleaned }}-amd64 \
|
|
--amend git.cryptic.systems/volker.raschek/markdownlint:${{ steps.version_extraction.outputs.version_cleaned }}-arm64
|
|
|
|
docker manifest push git.cryptic.systems/volker.raschek/markdownlint:${{ steps.version_extraction.outputs.version_cleaned }}
|
|
|
|
sync-to-hub-docker-io:
|
|
needs:
|
|
- push-manifest
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- id: version_extraction
|
|
name: Extract git tag
|
|
run: |
|
|
VERSION="${{ inputs.tag || github.ref_name }}"
|
|
VERSION="${VERSION#refs/*/}"
|
|
|
|
echo "Version (raw): ${VERSION}"
|
|
echo "Version (cleaned): ${VERSION/v/}"
|
|
|
|
echo "version_raw=${VERSION}" >> $GITHUB_OUTPUT
|
|
echo "version_cleaned=${VERSION/v/}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Copy images to docker.io
|
|
run: |
|
|
apt-get update --yes
|
|
apt-get install --yes skopeo
|
|
skopeo copy \
|
|
--all \
|
|
--dest-password ${{ secrets.DOCKER_IO_PASSWORD }} \
|
|
--dest-username ${{ secrets.DOCKER_IO_USERNAME }} \
|
|
--src-password ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }} \
|
|
--src-username volker.raschek \
|
|
docker://git.cryptic.systems/volker.raschek/markdownlint:${{ steps.version_extraction.outputs.version_cleaned }} \
|
|
docker://docker.io/volkerraschek/markdownlint:${{ steps.version_extraction.outputs.version_cleaned }}
|