-
Notifications
You must be signed in to change notification settings - Fork 8
82 lines (72 loc) · 2.08 KB
/
hexdoc-plugin.yml
File metadata and controls
82 lines (72 loc) · 2.08 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
name: "[Reusable] Build and publish a hexdoc plugin"
on:
workflow_call:
inputs:
python-version:
description: Python version to install
type: string
required: true
release:
description: If the book should be written to the release path or the latest path
type: boolean
required: true
props:
description: Path to your props file (hexdoc.toml or properties.toml)
type: string
required: false
pip-extras:
description: Pip extras for your package (eg. [dev])
type: string
required: false
pages-url:
type: string
default: https://example.com # lie
secrets:
GH_TOKEN:
required: true
outputs:
release:
description: Value of inputs.release for convenience
value: ${{ inputs.release }}
permissions:
contents: read
env:
HEXDOC_PROPS: ${{ inputs.props }}
HEXDOC_RELEASE: ${{ inputs.release }}
jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
permissions:
contents: read
pages: read
outputs:
pages-url: ${{ steps.export.outputs.pages-url }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
cache: pip
- uses: yezz123/setup-uv@v4
- name: Install display server
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: xvfb
- name: Install Python packages
run: uv pip install --system -e .${{ inputs.pip-extras }}
- name: Build web book
id: export
env:
GITHUB_PAGES_URL: ${{ inputs.pages-url }}
run: |
hexdoc build
hatch build --clean
- name: Upload package artifact
uses: actions/upload-artifact@v3
with:
name: hexdoc-build
path: dist
- name: Add job summary
run: echo "Built version \`$(hatch version)\` from commit \`$(git rev-parse --short "$GITHUB_SHA")\`." >> $GITHUB_STEP_SUMMARY