From c94d00263b080c0410fe0873da5347bc6f0d34a2 Mon Sep 17 00:00:00 2001 From: Patrick Schork <354473+pschork@users.noreply.github.com> Date: Sun, 2 Jun 2024 19:29:40 -0700 Subject: [PATCH] Add force flag to workflow for manually triggered untagged releases --- .github/workflows/docker-publish-release.yaml | 14 +++++++------- Makefile | 2 +- node/Makefile | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker-publish-release.yaml b/.github/workflows/docker-publish-release.yaml index d2d5037427..a5995b7280 100644 --- a/.github/workflows/docker-publish-release.yaml +++ b/.github/workflows/docker-publish-release.yaml @@ -9,10 +9,11 @@ on: pull_request: workflow_dispatch: inputs: - ref: - description: "Branch or SHA" + force: + description: "Force untagged release (expert mode)" required: false - type: string + default: false + type: boolean env: REGISTRY: ghcr.io @@ -29,7 +30,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: - ref: ${{ github.event.inputs.ref }} fetch-depth: 0 - name: Install GitVersion @@ -43,7 +43,7 @@ jobs: useConfigFile: true - run: | - echo "SemVer ${{ env.semVer }} FullSemVer ${{ env.fullSemVer }}" + echo "SemVer ${{ env.fullSemVer }} Forced ${{ github.event.inputs.force }}" name: Display SemVer - name: Setup Buildx @@ -74,7 +74,7 @@ jobs: run: make docker-release-build if: ${{ success() }} - # Publish if manually triggered or when semver tag is pushed + # Publish if release is tagged or force == true - name: Push docker image release run: make docker-release-push - if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v') + if: startsWith(github.ref, 'refs/tags/v') || github.event.inputs.force == 'true' diff --git a/Makefile b/Makefile index c40ad271c5..85be8b9723 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ SEMVER := $(shell basename $(CURDIR)) else GITCOMMIT := $(shell git rev-parse --short HEAD) GITDATE := $(shell git log -1 --format=%cd --date=unix) -SEMVER := $(shell docker run --rm --volume "$(PWD):/repo" gittools/gitversion:5.12.0 /repo -output json -showvariable SemVer) +SEMVER := $(shell docker run --rm --volume "$(PWD):/repo" gittools/gitversion:5.12.0 /repo -output json -showvariable FullSemVer) ifeq ($(SEMVER), ) $(warning semver disabled - docker not installed) SEMVER := "0.0.0" diff --git a/node/Makefile b/node/Makefile index 6b2715211d..49d8276a58 100644 --- a/node/Makefile +++ b/node/Makefile @@ -6,7 +6,7 @@ SEMVER := $(shell basename $(CURDIR)) else GITCOMMIT := $(shell git rev-parse --short HEAD) GITDATE := $(shell git log -1 --format=%cd --date=unix) -SEMVER := $(shell docker run --rm --volume "$(PWD)/../:/repo" gittools/gitversion:5.12.0 /repo -output json -showvariable SemVer) +SEMVER := $(shell docker run --rm --volume "$(PWD)/../:/repo" gittools/gitversion:5.12.0 /repo -output json -showvariable FullSemVer) ifeq ($(SEMVER), ) $(warning semver disabled - docker not installed) SEMVER := "0.0.0"