Fix Docker publish release trigger

This commit is contained in:
Diocrafts
2026-04-22 22:40:32 +02:00
parent c0cb86c273
commit 7809d998de
+9 -4
View File
@@ -4,6 +4,9 @@ on:
push: push:
tags: tags:
- "v*" - "v*"
release:
types:
- published
workflow_dispatch: workflow_dispatch:
inputs: inputs:
version: version:
@@ -38,8 +41,8 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v6 uses: actions/checkout@v6
with: with:
# For workflow_dispatch, checkout the exact tag so we build the right code # Build the exact tag behind the published release or manual dispatch.
ref: ${{ github.event.inputs.version || github.ref }} ref: ${{ github.event.inputs.version || github.event.release.tag_name || github.ref }}
- uses: dtolnay/rust-toolchain@stable - uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
@@ -60,14 +63,16 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v6 uses: actions/checkout@v6
with: with:
# For workflow_dispatch, checkout the exact tag so we build the right code # Build the exact tag behind the published release or manual dispatch.
ref: ${{ github.event.inputs.version || github.ref }} ref: ${{ github.event.inputs.version || github.event.release.tag_name || github.ref }}
- name: Set version tag - name: Set version tag
id: version id: version
run: | run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
VERSION="${{ github.event.inputs.version }}" VERSION="${{ github.event.inputs.version }}"
elif [ "${{ github.event_name }}" == "release" ]; then
VERSION="${{ github.event.release.tag_name }}"
else else
VERSION="${GITHUB_REF#refs/tags/}" VERSION="${GITHUB_REF#refs/tags/}"
fi fi