-
Notifications
You must be signed in to change notification settings - Fork 2
32 lines (30 loc) · 1.03 KB
/
Copy pathbuild.yml
File metadata and controls
32 lines (30 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Publish to PyPI and attach build artifacts to the release
on:
release:
types: [published]
jobs:
pypi-publish:
name: Build, publish to PyPI, attach to release
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/testingbotclient
permissions:
id-token: write # OIDC trusted publishing to PyPI
contents: write # upload built artifacts to the GitHub release
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install build tooling
run: python -m pip install --upgrade pip build
- name: Build package
run: python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Attach distributions to the GitHub release
run: gh release upload "${{ github.event.release.tag_name }}" dist/*.whl dist/*.tar.gz --clobber
env:
GH_TOKEN: ${{ github.token }}