Skip to content

add release workflow + update version #1

add release workflow + update version

add release workflow + update version #1

Workflow file for this run

name: Build and publish package
on:
push:
tags:
- 'v*.*.*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
tests:
uses: ./.github/workflows/ci.yml

Check failure on line 12 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yml

Invalid workflow file

error parsing called workflow ".github/workflows/release.yml" -> "./.github/workflows/ci.yml" (source tag with sha:7372319e067a9f0c482861b8ad81991a2550274b) : workflow is not reusable as it is missing a `on.workflow_call` trigger
build:
name: Build package and upload artifacts
needs: tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install hatch
uses: pypa/hatch@install
- name: Check versions match
run: |
pkg_version=$(hatch version)
tag_version=${GITHUB_REF#refs/tags/v}
if [ "$pkg_version" != "$tag_version" ]; then
echo "Package version ($pkg_version) does not match git tag version ($tag_version)"
exit 1
fi
- name: Build package
run: hatch build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: cleanlab-agility
path: dist/*
if-no-files-found: error
publish-pypi:
name: Publish to PyPI
needs: build
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: cleanlab-agility
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1