-
Notifications
You must be signed in to change notification settings - Fork 11
59 lines (49 loc) · 1.49 KB
/
publish.yaml
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
56
57
58
59
name: publish
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
inputs:
release_to_pypi:
type: boolean
default: true
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pdftotext
uses: daaku/gh-action-apt-install@v4
with:
packages: build-essential libpoppler-cpp-dev pkg-config ocrmypdf
- name: Setup Python & Poetry
uses: ./.github/actions/setup-python-poetry
with:
python-version: "3.11"
poetry-version: "1.8.3"
- name: Build source and wheels
run: poetry build
- name: Release to PyPI
if: inputs.release_to_pypi || github.event_name == 'push'
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.MONOPOLY_PYPI_TOKEN }}
run: poetry publish
- name: Get monopoly version
id: monopoly_version
run: echo "monopoly_version=$(poetry version --short)" >> $GITHUB_OUTPUT
- name: Create release changelog
run: poetry run git cliff --latest > RELEASE_CHANGELOG.md
- name: Create a Github Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.monopoly_version.outputs.monopoly_version }}
target_commitish: main
body_path: RELEASE_CHANGELOG.md
files: |
LICENSE.md
dist/*monopoly*.whl
dist/*monopoly*.tar.gz