Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Removed publish workflow redundant prepare step
  • Loading branch information
Am1n3e committed Feb 7, 2026
commit cbf8461688a7cc180a46f30838903e7517188079
60 changes: 10 additions & 50 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,9 @@ permissions:
id-token: write # Required for trusted publishing

jobs:
prepare:
name: Prepare Release
runs-on: ubuntu-latest
permissions:
contents: read
actions: write
outputs:
tag: ${{ steps.release-meta.outputs.tag }}
version: ${{ steps.release-meta.outputs.version }}
prerelease: ${{ steps.release-meta.outputs.prerelease }}
steps:
- name: Validate and derive release metadata
id: release-meta
run: |
TAG="${{ github.event.inputs.tag }}"
if [[ -z "$TAG" ]]; then
echo "::error::Missing tag input."
exit 1
fi
if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?$ ]]; then
echo "::error::Invalid version tag format: $TAG"
echo "Expected format: v1.2.3 or v1.2.3-rc.1"
exit 1
fi
VERSION="${TAG#v}"
if [[ "$TAG" == *-* ]]; then
PRERELEASE="true"
else
PRERELEASE="false"
fi
{
echo "tag=$TAG"
echo "version=$VERSION"
echo "prerelease=$PRERELEASE"
} >> "$GITHUB_OUTPUT"

publish_pypi:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: prepare
permissions:
contents: read
actions: write
Expand All @@ -63,7 +26,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: refs/tags/${{ needs.prepare.outputs.tag }}
ref: refs/tags/${{ github.event.release.tag_name }}
fetch-depth: 0

- name: Setup environment
Expand All @@ -80,7 +43,6 @@ jobs:
publish_docker:
name: Publish Docker Image
runs-on: ubuntu-latest
needs: prepare
permissions:
contents: read
actions: write
Expand All @@ -89,7 +51,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
ref: refs/tags/${{ needs.prepare.outputs.tag }}
ref: refs/tags/${{ github.event.release.tag_name }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -109,9 +71,9 @@ jobs:
run: |
REPO_LC="$(echo "${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]')"
IMAGE="ghcr.io/${REPO_LC}"
VERSION="${{ needs.prepare.outputs.version }}"
VERSION="${{ github.event.release.tag_name }}"
TAGS="$IMAGE:$VERSION"
if [ "${{ needs.prepare.outputs.prerelease }}" = "false" ]; then
if [ "${{ github.event.release.prerelease }}" = "false" ]; then
TAGS="$TAGS,$IMAGE:latest"
fi
echo "tags=$TAGS" >> "$GITHUB_OUTPUT"
Expand All @@ -122,7 +84,7 @@ jobs:
context: .
push: true
build-args: |
WBV_VERSION=${{ needs.prepare.outputs.version }}
WBV_VERSION=${{ github.event.release.tag_name }}
tags: ${{ steps.image-tags.outputs.tags }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
Expand All @@ -131,15 +93,14 @@ jobs:
publish_hf_dataset:
name: Publish HF Dataset
runs-on: ubuntu-latest
needs: prepare
permissions:
contents: read
actions: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: refs/tags/${{ needs.prepare.outputs.tag }}
ref: refs/tags/${{ github.event.release.tag_name }}
fetch-depth: 0

- name: Setup environment
Expand All @@ -148,7 +109,7 @@ jobs:
sync-args: --group dev

- name: Build HF dataset artifacts
run: uv run inv dev.release.build-hf-dataset --version "${{ needs.prepare.outputs.tag }}"
run: uv run inv dev.release.build-hf-dataset --version "${{ github.event.release.tag_name }}"

- name: Test HF dataset artifacts (local parity)
run: uv run pytest tests/dataset/test_hf_dataset.py -v --hf-dataset-ref output/build/hf_dataset
Expand All @@ -158,22 +119,21 @@ jobs:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
uv run inv dev.release.upload-hf-dataset \
--version "${{ needs.prepare.outputs.tag }}" \
--version "${{ github.event.release.tag_name }}" \
--folder-path output/build/hf_dataset \
--token "${HF_TOKEN}"

publish_docs:
name: Publish Docs
runs-on: ubuntu-latest
needs: prepare
permissions:
contents: write
actions: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: refs/tags/${{ needs.prepare.outputs.tag }}
ref: refs/tags/${{ github.event.release.tag_name }}
fetch-depth: 0

- name: Setup environment
Expand All @@ -188,6 +148,6 @@ jobs:

- name: Deploy release docs
run: |
VERSION="${{ needs.prepare.outputs.version }}"
VERSION="${{ github.event.release.tag_name }}"
uv run mike deploy --push --update-aliases "$VERSION" latest
uv run mike set-default --push latest
Loading