diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 0000000..71e3be2 --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,71 @@ +name: Release to PyPI + +permissions: + contents: write + +on: + push: + tags: + - "v*" + +jobs: + build: + name: build dist files + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: install build + run: python -m pip install --upgrade build + + - name: build dist + run: python -m build + + - uses: actions/upload-artifact@v3 + with: + name: artifacts + path: dist/* + if-no-files-found: error + + publish: + environment: + name: pypi-release + + name: release to pypi + needs: build + runs-on: ubuntu-latest + + steps: + - uses: actions/download-artifact@v3 + with: + name: artifacts + path: dist + + - name: Push build artifacts to PyPI + uses: pypa/gh-action-pypi-publish@v1.6.4 + with: + skip_existing: true + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + + release: + name: write release note + runs-on: ubuntu-latest + needs: publish + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-node@v3 + with: + node-version: 18 + - run: npx changelogithub --no-group + continue-on-error: true + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8162a40..8f0d01f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,7 @@ jobs: max-parallel: 6 matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python: ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy3.9"] + python: ["3.8", "3.9", "3.10", "3.11", "pypy3.9"] steps: - uses: actions/checkout@v3