This repository was archived by the owner on Jun 30, 2025. It is now read-only.
Bump version to 0.7.0 for release #20
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build and release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Checkout release branch | |
| run: | | |
| # Fetch all branches to ensure we can access the one we need | |
| git fetch --all | |
| # Get the tag without the 'v' and strip the patch version | |
| VERSION_TAG="${GITHUB_REF#refs/tags/v}" | |
| VERSION_MAJOR_MINOR="${VERSION_TAG%.*}" # This removes the patch version (everything after the second dot) | |
| # Construct the branch name (e.g., release/0.1) | |
| BRANCH_NAME="release/$VERSION_MAJOR_MINOR" | |
| # Check out the corresponding release branch (e.g., release/0.1) | |
| git checkout $BRANCH_NAME | |
| # Ensure the branch is up-to-date with the remote | |
| git pull origin $BRANCH_NAME | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install build dependencies | |
| run: pip install --upgrade build | |
| - name: Build package | |
| run: python -m build | |
| - name: Create GitHub Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| draft: true | |
| files: | | |
| dist/* | |
| # Uncomment and modify this for PyPI publishing in the future | |
| # - name: Publish to PyPI | |
| # if: false # Set to `true` or remove when ready | |
| # env: | |
| # PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
| # run: | | |
| # pip install --upgrade twine | |
| # twine upload dist/* |