-
Notifications
You must be signed in to change notification settings - Fork 129
46 lines (38 loc) · 1020 Bytes
/
release.yml
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
name: release
on:
release:
types: [published]
workflow_dispatch:
inputs:
ref:
description: 'Tag to release'
required: true
jobs:
release:
runs-on: ubuntu-latest
# Needed for trusted publishing
permissions:
id-token: write
steps:
# Check out the repo
- uses: actions/checkout@v4
if: ${{ github.event_name == 'release' }}
- uses: actions/checkout@v4
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
ref: ${{ github.event.inputs.ref }}
# Setup python
- uses: actions/setup-python@v4
with:
python-version: "3.x"
# Build it
- name: Build a binary wheel and a source tarball
run: |
python -m pip install hatch
hatch run docs:man
hatch build
# Publish it
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/