From 7809d998de38a2b06e979b0328f8097c28d0c41f Mon Sep 17 00:00:00 2001 From: Diocrafts Date: Wed, 22 Apr 2026 22:40:32 +0200 Subject: [PATCH] Fix Docker publish release trigger --- .github/workflows/docker-publish.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 346e6a2b..09d8c08f 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -4,6 +4,9 @@ on: push: tags: - "v*" + release: + types: + - published workflow_dispatch: inputs: version: @@ -38,8 +41,8 @@ jobs: - name: Checkout uses: actions/checkout@v6 with: - # For workflow_dispatch, checkout the exact tag so we build the right code - ref: ${{ github.event.inputs.version || github.ref }} + # Build the exact tag behind the published release or manual dispatch. + ref: ${{ github.event.inputs.version || github.event.release.tag_name || github.ref }} - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 @@ -60,14 +63,16 @@ jobs: - name: Checkout uses: actions/checkout@v6 with: - # For workflow_dispatch, checkout the exact tag so we build the right code - ref: ${{ github.event.inputs.version || github.ref }} + # Build the exact tag behind the published release or manual dispatch. + ref: ${{ github.event.inputs.version || github.event.release.tag_name || github.ref }} - name: Set version tag id: version run: | if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then VERSION="${{ github.event.inputs.version }}" + elif [ "${{ github.event_name }}" == "release" ]; then + VERSION="${{ github.event.release.tag_name }}" else VERSION="${GITHUB_REF#refs/tags/}" fi