Fix: Building of tags with and without 'v' prefix.

This commit is contained in:
Bojan Čekrlić 2023-10-27 06:17:28 +02:00
parent 2371eee943
commit ce550c69b6
4 changed files with 26 additions and 15 deletions

View file

@ -13,9 +13,5 @@ runs:
with:
install: true
- name: Get release version
id: version_number
shell: bash
run: |
echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_OUTPUT
# Release version setup
- uses: ./.github/actions/get-release-version

View file

@ -0,0 +1,14 @@
name: 'Get release version'
description: 'Setup RELEASE_VERSION environment variable from GITHUB_REF'
runs:
using: "composite"
steps:
- name: Get release version
id: version_number
shell: bash
run: |
echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_OUTPUT
echo "RELEASE_VERSION_NO_v=${GITHUB_REF:11}" >> $GITHUB_ENV
echo "RELEASE_VERSION_NO_v=${GITHUB_REF:11}" >> $GITHUB_OUTPUT

View file

@ -51,6 +51,7 @@ jobs:
with:
repository: kumina/postfix_exporter
path: 'postfix_exporter'
ref: 'a6f58e9b2b2b4decc7e65c5a34b4fd53cd6665f1' # Latest commit we know that works
# Buildkit setup
- uses: ./.github/actions/buildx-setup

View file

@ -75,7 +75,7 @@ jobs:
push: true
tags: |
boky/postfix-exporter:${{ env.RELEASE_VERSION }}
boky/postfix-exporter:${{ env.RELEASE_VERSION }}
boky/postfix-exporter:${{ env.RELEASE_VERSION_NO_v }}
platforms: "linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le"
cache-from: type=local,src=/tmp/.buildx-cache/postfix-exporter,mode=max,compression=estargz
cache-to: type=local,dest=/tmp/.buildx-cache-new/postfix-exporter
@ -127,6 +127,8 @@ jobs:
tags: |
boky/postfix:${{ env.RELEASE_VERSION }}
boky/postfix:${{ env.RELEASE_VERSION }}-alpine
boky/postfix:${{ env.RELEASE_VERSION_NO_v }}
boky/postfix:${{ env.RELEASE_VERSION_NO_v }}-alpine
# linux/s390x: "rsyslog (no such package)"
# Latest Alpine does not have all packages for 386 any more :-(
platforms: "linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le"
@ -175,7 +177,9 @@ jobs:
with:
context: .
push: true
tags: boky/postfix:${{ env.RELEASE_VERSION }}-ubuntu
tags: |
boky/postfix:${{ env.RELEASE_VERSION }}-ubuntu
boky/postfix:${{ env.RELEASE_VERSION_NO_v }}-ubuntu
platforms: "linux/arm/v7,linux/amd64,linux/arm64,linux/ppc64le,linux/s390x"
cache-from: type=local,src=/tmp/.buildx-cache/ubuntu,mode=max,compression=estargz
cache-to: type=local,dest=/tmp/.buildx-cache-new/ubuntu
@ -203,12 +207,8 @@ jobs:
with:
fetch-depth: 0
- name: Get release version
id: version_number
shell: bash
run: |
echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_OUTPUT
# Release version setup
- uses: ./.github/actions/get-release-version
- name: Checkout gh-pages
uses: actions/checkout@v4
@ -238,7 +238,7 @@ jobs:
- name: Package helm chart with X.Y.Z
uses: WyriHaximus/github-action-helm3@v3
with:
exec: helm package --app-version "${RELEASE_VERSION#v}" --version "${RELEASE_VERSION#v}" --destination ./gh-pages helm/mail
exec: helm package --app-version "${RELEASE_VERSION_NO_v}" --version "${RELEASE_VERSION_NO_v}" --destination ./gh-pages helm/mail
- name: Create helm chart index
uses: WyriHaximus/github-action-helm3@v3