Pre release a2 #3
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: Publish Python Package to PyPI | |
| on: | |
| release: | |
| types: [published] # This workflow runs when you publish a new GitHub release | |
| jobs: | |
| pypi-publish: | |
| name: Build and publish package to PyPI | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi # This should match the environment name in your PyPI project settings | |
| url: https://pypi.org/p/SynapticSync # The URL to your project on PyPI | |
| permissions: | |
| id-token: write # This is required for trusted publishing | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetches all history for all branches and tags | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" # Match this to your project's Python version | |
| - name: Install Poetry | |
| uses: snok/install-poetry@v1 | |
| - name: Install dependencies | |
| run: poetry install --no-interaction | |
| - name: Remove old build artifacts | |
| run: rm -rf dist/ | |
| - name: Set version from tag | |
| run: | | |
| # This command takes the git tag (e.g., v0.1.0), removes the 'v' prefix, | |
| # and then tells poetry to set the project version to that number. | |
| VERSION=$(echo ${{ github.ref_name }} | sed 's/^v//') | |
| poetry version $VERSION | |
| - name: Build package | |
| run: poetry build | |
| - name: Publish package to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |