-
Notifications
You must be signed in to change notification settings - Fork 49
55 lines (46 loc) · 1.15 KB
/
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
47
48
49
50
51
52
53
54
55
name: Release
on:
workflow_dispatch:
inputs:
release_enabled:
description: "Release the package to PyPI"
required: true
type: boolean
default: false
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
pip --version
- name: Install hatch
run: |
pip install hatch
hatch --version
- name: Build package
run: |
hatch build
- name: Publish package on PyPI
if: ${{ inputs.release_enabled }}
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
- name: Publish the release notes
if: ${{ inputs.release_enabled }}
uses: release-drafter/release-drafter@v5.25.0
with:
publish: true
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}