Skip to content
Merged
Show file tree
Hide file tree
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
69 changes: 69 additions & 0 deletions .github/workflows/publish-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Publish Python Packages
on:
workflow_dispatch:
inputs:
version:
description: "Release version to publish. Leave empty when running on a tag ref."
required: false
type: string
target:
description: "Package set to publish"
required: true
Expand All @@ -20,7 +24,57 @@ permissions:
contents: read

jobs:
resolve-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.resolve.outputs.version }}
steps:
- name: Resolve release version
id: resolve
shell: bash
env:
INPUT_VERSION: ${{ github.event.inputs.version }}
REF_NAME: ${{ github.ref_name }}
REF_TYPE: ${{ github.ref_type }}
run: |
version="${INPUT_VERSION}"
if [ -z "$version" ]; then
if [ "$REF_TYPE" = "tag" ]; then
version="$REF_NAME"
else
echo "::error::Set the version input or run this workflow on a tag ref."
exit 1
fi
fi

version="${version#refs/tags/}"
version="${version#v}"
if ! [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "::error::Expected semantic version like 0.1.1, got: $version"
exit 1
fi

echo "version=$version" >> "$GITHUB_OUTPUT"

version-check:
needs: resolve-version
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Sync lockstep versions to release version
run: python3 scripts/manage_versions.py set "${{ needs.resolve-version.outputs.version }}"

- name: Validate lockstep package versions
run: python3 scripts/manage_versions.py check --tag "${{ needs.resolve-version.outputs.version }}"

build-package:
needs:
- resolve-version
- version-check
strategy:
matrix:
include:
Expand All @@ -43,6 +97,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v5

- name: Sync lockstep versions to release version
run: python3 scripts/manage_versions.py set "${{ needs.resolve-version.outputs.version }}"

- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
Expand All @@ -68,6 +125,9 @@ jobs:
path: dist/*

build-bindings-wheels:
needs:
- resolve-version
- version-check
if: ${{ github.event.inputs.target == 'all' || github.event.inputs.target == 'bootstrap-1' }}
strategy:
matrix:
Expand All @@ -91,6 +151,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v5

- name: Sync lockstep versions to release version
run: python3 scripts/manage_versions.py set "${{ needs.resolve-version.outputs.version }}"

- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
Expand Down Expand Up @@ -132,6 +195,9 @@ jobs:
path: dist/*

build-bindings-sdist:
needs:
- resolve-version
- version-check
if: ${{ github.event.inputs.target == 'all' || github.event.inputs.target == 'bootstrap-1' }}
runs-on: ubuntu-latest
permissions:
Expand All @@ -140,6 +206,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v5

- name: Sync lockstep versions to release version
run: python3 scripts/manage_versions.py set "${{ needs.resolve-version.outputs.version }}"

- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/publish-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,40 @@ on:
permissions:
contents: read

env:
RELEASE_VERSION: ${{ github.ref_name }}

concurrency:
group: publish-rust-${{ github.ref_name }}
cancel-in-progress: false

jobs:
version-check:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Sync lockstep versions to release tag
run: python3 scripts/manage_versions.py set "${{ env.RELEASE_VERSION }}"

- name: Validate lockstep versions against tag
run: python3 scripts/manage_versions.py check --tag "${{ env.RELEASE_VERSION }}"

package-check:
needs: version-check
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Sync lockstep versions to release tag
run: python3 scripts/manage_versions.py set "${{ env.RELEASE_VERSION }}"

- name: Set up Rust
uses: dtolnay/rust-toolchain@1.94.0

Expand All @@ -38,6 +59,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v5

- name: Sync lockstep versions to release tag
run: python3 scripts/manage_versions.py set "${{ env.RELEASE_VERSION }}"

- name: Set up Rust
uses: dtolnay/rust-toolchain@1.94.0

Expand All @@ -57,6 +81,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v5

- name: Sync lockstep versions to release tag
run: python3 scripts/manage_versions.py set "${{ env.RELEASE_VERSION }}"

- name: Set up Rust
uses: dtolnay/rust-toolchain@1.94.0

Expand All @@ -79,6 +106,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v5

- name: Sync lockstep versions to release tag
run: python3 scripts/manage_versions.py set "${{ env.RELEASE_VERSION }}"

- name: Set up Rust
uses: dtolnay/rust-toolchain@1.94.0

Expand All @@ -98,6 +128,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v5

- name: Sync lockstep versions to release tag
run: python3 scripts/manage_versions.py set "${{ env.RELEASE_VERSION }}"

- name: Set up Rust
uses: dtolnay/rust-toolchain@1.94.0

Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/release-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,19 @@ concurrency:
cancel-in-progress: true

jobs:
version-check:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Validate lockstep package versions
run: python3 scripts/manage_versions.py check

verify-package-distributions:
needs: version-check
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -43,6 +55,7 @@ jobs:
run: uvx twine check dist/*

verify-bindings-wheels:
needs: version-check
strategy:
matrix:
include:
Expand Down
Loading
Loading