Skip to content

Sync uv before hatch step #9

Sync uv before hatch step

Sync uv before hatch step #9

Workflow file for this run

name: Release
on:
push:
branches:
- dev
- main
jobs:
update-version-minor:
name: Bump Version and Commit
if: github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- name: Install the project
run: uv sync
- name: Bump Version
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
VERSION=$(uvx hatch version)
hatch version minor
NEW_VERSION=$(uvx hatch version)
git add src/cloud_autopkg_runner/__about__.py
git commit -m "Bump version: ${VERSION} → ${NEW_VERSION}"
git tag ${VERSION}
git push
git push --tags
publish-to-testpypi:
name: Publish to TestPyPI
needs: [update-version-minor]
runs-on: ubuntu-latest
environment:
name: TestPyPi
url: https://test.pypi.org/p/cloud-autopkg-runner
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- name: Build
run: uv build
- name: Publish
run: uv publish --index testpypi --trusted-publishing always
install-library-from-testpypi:
name: Install from TestPyPI
needs: [publish-to-testpypi]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- name: Install
run: uv run --with cloud-autopkg-runner --extra-index-url https://test.pypi.org/simple/ --index-strategy unsafe-best-match --no-project -- python -c "import cloud_autopkg_runner"
update-version-release:
name: Bump Version and Commit
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- name: Install the project
run: uv sync
- name: Bump Version
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
VERSION=$(uvx hatch version)
hatch version release
NEW_VERSION=$(uvx hatch version)
git add src/cloud_autopkg_runner/__about__.py
git commit -m "Bump version: ${VERSION} → ${NEW_VERSION}"
git tag ${VERSION}
git push
git push --tags
publish-to-pypi:
name: Publish to PyPI
if: github.ref == 'refs/heads/main'
needs: [update-version-release]
runs-on: ubuntu-latest
environment:
name: PyPi
url: https://pypi.org/p/cloud-autopkg-runner
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- name: Build
run: uv build
- name: Publish
run: uv publish --trusted-publishing always
install-library-from-pypi:
name: Install from PyPI
needs: [publish-to-pypi]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- name: Install
run: uv run --with cloud-autopkg-runner --no-project -- python -c "import cloud_autopkg_runner"