refactor: change tag-trigger-ref into release-trigger-tag

Improves the readability of the workflow.

PR: #37
This commit is contained in:
innovaker 2021-05-14 19:12:34 +01:00
parent ae59587197
commit f5bf7843a0

View File

@ -71,8 +71,8 @@ jobs:
LATEST_TAG=${NAME}:${MAJOR_MINOR} LATEST_TAG=${NAME}:${MAJOR_MINOR}
echo ::set-output name=latest-tag::${LATEST_TAG} echo ::set-output name=latest-tag::${LATEST_TAG}
TAG_TRIGGER_REF=refs/tags/${{ env.zephyr-version }}-${{ env.zephyr-sdk-version }} RELEASE_TRIGGER_TAG=${{ env.zephyr-version }}-${{ env.zephyr-sdk-version }}
echo ::set-output name=tag-trigger-ref::${TAG_TRIGGER_REF} echo ::set-output name=release-trigger-tag::${RELEASE_TAG}
- name: Set up QEMU - name: Set up QEMU
if: ${{ !startsWith(github.ref, 'refs/tags') }} if: ${{ !startsWith(github.ref, 'refs/tags') }}
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v1
@ -97,7 +97,7 @@ jobs:
cache-to: ${{ (steps.docker-hub-login.outcome == 'success') && (matrix.target == 'dev') && format('type=registry,ref=docker.io/{0}/{1}:{2},mode=max', steps.vars.outputs.docker-hub-namespace, env.cache-repository-name, 'dev') || null }} cache-to: ${{ (steps.docker-hub-login.outcome == 'success') && (matrix.target == 'dev') && format('type=registry,ref=docker.io/{0}/{1}:{2},mode=max', steps.vars.outputs.docker-hub-namespace, env.cache-repository-name, 'dev') || null }}
push: ${{ steps.docker-hub-login.outcome == 'success' }} push: ${{ steps.docker-hub-login.outcome == 'success' }}
- name: Release (pull candidate, tag, push) - name: Release (pull candidate, tag, push)
if: ${{ github.ref == steps.vars.outputs.tag-trigger-ref }} if: ${{ github.ref == format('refs/tags/{0}', steps.vars.outputs.release-trigger-tag) }}
run: | run: |
if [ "${{ steps.docker-hub-login.outcome }}" != "success" ]; then if [ "${{ steps.docker-hub-login.outcome }}" != "success" ]; then
echo "Docker Hub must be authenticated to perform a release!" echo "Docker Hub must be authenticated to perform a release!"
@ -132,13 +132,13 @@ jobs:
MAJOR_MINOR=${MAJOR}.${MINOR} MAJOR_MINOR=${MAJOR}.${MINOR}
echo ::set-output name=major-minor::${MAJOR_MINOR} echo ::set-output name=major-minor::${MAJOR_MINOR}
TAG_TRIGGER_REF=refs/tags/${{ env.zephyr-version }}-${{ env.zephyr-sdk-version }} RELEASE_TRIGGER_TAG=${{ env.zephyr-version }}-${{ env.zephyr-sdk-version }}
echo ::set-output name=tag-trigger-ref::${TAG_TRIGGER_REF} echo ::set-output name=release-trigger-tag::${RELEASE_TAG}
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
if: ${{ github.ref == steps.vars.outputs.tag-trigger-ref }} if: ${{ github.ref == format('refs/tags/{0}', steps.vars.outputs.release-trigger-tag) }}
- name: Tag - name: Tag
if: ${{ github.ref == steps.vars.outputs.tag-trigger-ref }} if: ${{ github.ref == format('refs/tags/{0}', steps.vars.outputs.release-trigger-tag) }}
env: env:
TAG: ${{ steps.vars.outputs.major-minor }} TAG: ${{ steps.vars.outputs.major-minor }}
run: | run: |