Skip to content

Commit

Permalink
Fix: Building of tags with and without 'v' prefix.
Browse files Browse the repository at this point in the history
  • Loading branch information
bokysan committed Oct 27, 2023
1 parent 2371eee commit ce550c6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
8 changes: 2 additions & 6 deletions .github/actions/buildx-setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 14 additions & 0 deletions .github/actions/get-release-version/action.yaml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ce550c6

Please sign in to comment.