Skip to content

Commit

Permalink
fix: update docker publish workflow to handle releases properly
Browse files Browse the repository at this point in the history
  • Loading branch information
remsky committed Feb 7, 2025
1 parent 5c62536 commit bfdb5c0
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
- '**.md'
- 'docs/**'
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g. v0.2.0)'
required: true
type: string

jobs:
prepare-release:
Expand All @@ -20,11 +25,16 @@ jobs:

- name: Get version
id: get-version
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
else
echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
fi
- name: Check if prerelease
id: check-prerelease
run: echo "is_prerelease=${{ contains(github.ref, '-pre') }}" >> $GITHUB_OUTPUT
run: echo "is_prerelease=${{ contains(steps.get-version.outputs.version, '-pre') }}" >> $GITHUB_OUTPUT

build-images:
needs: prepare-release
Expand Down Expand Up @@ -78,9 +88,15 @@ jobs:
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.prepare-release.outputs.version }}
generate_release_notes: true
draft: true
prerelease: ${{ needs.prepare-release.outputs.is_prerelease }}

0 comments on commit bfdb5c0

Please sign in to comment.