-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (33 loc) · 953 Bytes
/
publish.yml
File metadata and controls
42 lines (33 loc) · 953 Bytes
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
name: Publish to PyPI
on:
workflow_run:
workflows: ["Release New Version"]
types: [completed]
jobs:
publish-to-pypi:
name: Publish Python distribution to PyPI
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/office-templates
permissions:
id-token: write
steps:
- name: Check out code
uses: actions/checkout@v6
with:
ref: main
fetch-depth: 0
- name: Checkout latest version tag
run: git checkout $(git describe --tags --abbrev=0)
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Build release distributions
run: |
python -m pip install build
python -m build
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1