Skip to content

Commit

Permalink
Add force flag to workflow for manually triggered untagged releases
Browse files Browse the repository at this point in the history
  • Loading branch information
pschork committed Jun 3, 2024
1 parent 1d3b524 commit c94d002
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/docker-publish-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -29,7 +30,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
fetch-depth: 0

- name: Install GitVersion
Expand All @@ -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
Expand Down Expand Up @@ -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'
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion node/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c94d002

Please sign in to comment.