-
Notifications
You must be signed in to change notification settings - Fork 96
103 lines (87 loc) · 2.55 KB
/
Copy pathrelease.yaml
File metadata and controls
103 lines (87 loc) · 2.55 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Release
on:
push:
tags: [ 'v*' ]
jobs:
test:
uses: ./.github/workflows/test.yaml
publish-to-pypi:
name: Build and Publish to PyPI
needs:
- test
if: "startsWith(github.ref, 'refs/tags/v')"
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/fast-plate-ocr
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Install uv (and Python 3.10)
uses: astral-sh/setup-uv@v6
with:
version: "latest"
python-version: "3.10"
enable-cache: true
- name: Build distributions (sdist + wheel)
run: uv build --no-sources
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
github-release:
name: Create GitHub release
needs:
- publish-to-pypi
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Check package version matches tag
id: check-version
uses: samuelcolvin/check-python-version@v4.1
with:
version_file_path: 'pyproject.toml'
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
tag: ${{ github.ref_name }}
run: |
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
--generate-notes
update_docs:
name: Update documentation
needs:
- github-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv (and Python 3.10)
uses: astral-sh/setup-uv@v6
with:
version: "latest"
python-version: "3.10"
enable-cache: true
- name: Configure Git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Retrieve version
id: check-version
uses: samuelcolvin/check-python-version@v4.1
with:
version_file_path: 'pyproject.toml'
skip_env_check: true
- name: Install docs dependencies
run: uv sync --locked --no-default-groups --group docs
- name: Deploy the docs
run: |
uv run mike deploy \
--update-aliases \
--push \
--branch docs-site \
${{ steps.check-version.outputs.VERSION_MAJOR_MINOR }} latest