-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.pypi.yaml
More file actions
53 lines (45 loc) · 1.63 KB
/
release.pypi.yaml
File metadata and controls
53 lines (45 loc) · 1.63 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
49
50
51
52
53
# Sample workflow for releasing a Python package to PyPI using reusable workflows from health-informatics-uon/workflows
# This demonstrates how to combine semantic-release with PyPI trusted publishing (OIDC)
# Customize the placeholders and values below for your specific project
name: Release
permissions:
contents: write
pull-requests: write
issues: write
id-token: write # required for PyPI trusted publishing
on:
push:
branches:
- main
jobs:
release:
uses: health-informatics-uon/workflows/.github/workflows/semantic-release.yml@6411293719f0d3fc7fddb74530d4435333460e4f # v 1.4.1
with:
node-version: "24"
secrets: inherit
# PyPI trusted publishing (OIDC) cannot be used from within a reusable workflow.
# This job must stay as a direct job in this non-reusable workflow — do not extract it.
# See: https://github.com/pypa/gh-action-pypi-publish/issues/166
publish-pypi:
needs: release
if: needs.release.outputs.release-created == 'true'
runs-on: ubuntu-latest
environment:
name: pypi
# Set your PyPI package name
url: https://pypi.org/p/<PACKAGE_NAME>
permissions:
id-token: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.x"
- name: Build package
run: |
pip install build
python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0