Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Extract the version using github action, not docker metadata

Oliver Günther8ddb3db34497
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index f516daeb7a3..a9076c52dcf 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -10,8 +10,8 @@ on:
- v*
workflow_dispatch:
inputs:
- version:
- description: "The version to release. Note that this happens by default on the tag push. Only run this action when something went wrong!"
+ tag:
+ description: "The tag to release. Note that this happens by default on the tag push. Only run this action when something went wrong!"
required: true
permissions:
@@ -40,13 +40,25 @@ jobs:
bim_support: false
target: all-in-one
steps:
+ - name: Extract version
+ id: extract_version
+ run: |
+ if [[ ${{ github.event_name }} == 'push' ]]; then
+ TAG_REF=${GITHUB_REF#refs/tags/}
+ elif [[ ${{ github.event_name }} == 'workflow_dispatch' ]]; then
+ TAG_REF=${{ inputs.tag }}
+ fi
+
+ VERSION=${TAG_REF#v}
+ echo "Version: $VERSION"
+ echo "::set-output name=version::$VERSION"
- name: Checkout current release
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v3
- name: Checkout specific version
if: ${{ github.event_name != 'push' }}
with:
- ref: ${{ inputs.version }}
+ ref: ${{ inputs.tag }}
uses: actions/checkout@v3
- name: Prepare docker files
run: |
@@ -65,6 +77,8 @@ jobs:
id: meta
uses: docker/metadata-action@v4
with:
+ tags: |
+ type=semver,pattern={{version}},value=${{ steps.extract_version.outputs.version }}
images: |
${{ env.REGISTRY_IMAGE }}
- name: Build image
@@ -149,9 +163,9 @@ jobs:
latest=false
suffix=${{ steps.set_suffix.outputs.suffix }}
tags: |
- type=semver,pattern={{version}}
- type=semver,pattern={{major}}.{{minor}}
- type=semver,pattern={{major}}
+ type=semver,pattern={{version}},value=${{ steps.extract_version.outputs.version }}
+ type=semver,pattern={{major}}.{{minor}},value=${{ steps.extract_version.outputs.version }}
+ type=semver,pattern={{major}},value=${{ steps.extract_version.outputs.version }}
type=raw,value=dev,priority=200,enable={{is_default_branch}}
- name: Login to Docker Hub
uses: docker/login-action@v2