[pre-commit.ci] pre-commit autoupdate #68
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: Build | |
on: [push, pull_request] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Install pyproject-build | |
run: pipx install build | |
- name: Build dists | |
run: pyproject-build | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: ./dist/* | |
publish: | |
name: Publish release | |
runs-on: ubuntu-22.04 | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
needs: build | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
- name: Make new release | |
run: > | |
gh release create ${{ github.ref_name }} \ | |
--repo ${{ github.repository }} \ | |
--generate-notes dist/* | |
env: | |
GH_TOKEN: ${{ github.token }} | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |