-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (43 loc) · 1.59 KB
/
build.yml
File metadata and controls
48 lines (43 loc) · 1.59 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Release
on:
push:
permissions:
contents: write # Needed to upload artifacts to the release
id-token: write # Needed for OIDC PyPI publishing
jobs:
build:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.baipp.outputs.package_version }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: hynek/build-and-inspect-python-package@efb823f52190ad02594531168b7a2d5790e66516 # v2.14.0
id: baipp
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [build]
## TODO: optionally provide the name of the environment for the trusted
## publisher on PyPI
## https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment
# environment:
# name: pypi
# url: https://pypi.org/project/ticketswap-target-notion/${{ steps.baipp.outputs.package_version }}
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: Packages
path: dist
- name: Upload wheel to release
uses: svenstaro/upload-release-action@6b7fa9f267e90b50a19fef07b3596790bb941741 # 2.11.3
with:
repo_token: ${{secrets.GITHUB_TOKEN}}
file: dist/*.whl
tag: ${{github.ref}}
overwrite: true
file_glob: true
- name: Publish
## TODO: create a trusted publisher on PyPI
## https://docs.pypi.org/trusted-publishers/
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0