From a44b8f68bbcb2704f2b5ce0041178b3d46e5baf4 Mon Sep 17 00:00:00 2001 From: Koen van der Veen Date: Wed, 18 Mar 2026 16:07:37 +0100 Subject: [PATCH] Add CD workflow for syft-dataset package --- .github/workflows/cd-syft-dataset.yml | 76 +++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .github/workflows/cd-syft-dataset.yml diff --git a/.github/workflows/cd-syft-dataset.yml b/.github/workflows/cd-syft-dataset.yml new file mode 100644 index 00000000..bf29b164 --- /dev/null +++ b/.github/workflows/cd-syft-dataset.yml @@ -0,0 +1,76 @@ +name: CD - Syft Dataset + +on: + workflow_dispatch: + inputs: + bump_type: + description: Version bump type + type: choice + default: patch + options: + - patch + - minor + - major + +concurrency: + group: 'CD - Syft Dataset' + cancel-in-progress: false + +jobs: + deploy-syft-dataset: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v6 + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: '3.12' + + - name: Install uv + uses: astral-sh/setup-uv@v7 + + - name: Configure git user + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + + - name: Bump version + working-directory: packages/syft-datasets + run: | + CURRENT=$(python -c " + import re + text = open('pyproject.toml').read() + print(re.search(r'version\s*=\s*\"(.+?)\"', text).group(1)) + ") + IFS='.' read -r major minor patch <<< "$CURRENT" + case "${{ github.event.inputs.bump_type }}" in + major) major=$((major + 1)); minor=0; patch=0 ;; + minor) minor=$((minor + 1)); patch=0 ;; + patch) patch=$((patch + 1)) ;; + esac + NEW="$major.$minor.$patch" + sed -i "s/version = \"$CURRENT\"/version = \"$NEW\"/" pyproject.toml + echo "VERSION=$NEW" >> $GITHUB_ENV + echo "Bumped syft-dataset from $CURRENT to $NEW" + + - name: Build package + working-directory: packages/syft-datasets + run: uv build + + - name: Publish to PyPI + working-directory: packages/syft-datasets + env: + TWINE_USERNAME: ${{ secrets.PYPI_UNAME_SYFT_CLIENT }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASS_SYFT_CLIENT }} + run: uvx twine upload dist/* + + - name: Commit and tag + run: | + git add packages/syft-datasets/pyproject.toml + git commit -m "Release syft-dataset v${{ env.VERSION }}" + git tag "syft-dataset/v${{ env.VERSION }}" + git push origin --follow-tags