1.1.7 #6
Workflow file for this run
This file contains 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: 'PyPI publish' | |
on: | |
release: | |
types: [published] | |
jobs: | |
pypi-publish: | |
name: Upload release to PyPI | |
runs-on: ubuntu-latest | |
if: github.event.release.target_commitish == 'main' | |
environment: | |
name: pypi | |
url: https://pypi.org/p/clusopt_core | |
permissions: | |
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
# Give the default GITHUB_TOKEN write permission to commit and push the | |
# added or changed files to the repository. | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Bump version | |
run: | | |
NEW_VERSION=${{ github.event.release.tag_name }} | |
sed -i "s/version = .*/version = \"$NEW_VERSION\"/" setup.py | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.12 | |
- name: update pip | |
run: python -m pip install --upgrade pip | |
- name: install build | |
run: pip install build==1.2.1 | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Build | |
run: python -m build --sdist . | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |