Introduce pre-commit #388
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: Packaging | |
on: | |
# Make sure packaging process is not broken | |
push: | |
branches: [master] | |
pull_request: | |
# Make a package for release | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.13] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: python -m pip install --upgrade build | |
- name: Create packages | |
run: python -m build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: tox-gh-actions-dist | |
path: dist | |
pypi-publish: | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' | |
environment: pypi | |
permissions: | |
id-token: write # Required for using pypa/gh-actions-pypi-publish | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: tox-gh-actions-dist | |
path: dist | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
github-release: | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' | |
environment: release | |
permissions: | |
contents: write # Required for uploading artifacts to GitHub release | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: tox-gh-actions-dist | |
path: dist | |
- name: Upload artifacts to GitHub release | |
working-directory: ./dist | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: gh release upload "${{ github.event.release.tag_name }}" ./* |