-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (76 loc) · 2.47 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
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
name: Release
run-name: ${{ github.actor }} is releasing peprock 🚀
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
increment:
description: 'Increment'
type: choice
options:
- ""
- "MAJOR"
- "MINOR"
- "PATCH"
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
id-token: write
env:
UV_PYTHON_PREFERENCE: only-system
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
with:
fetch-depth: 0
- id: uv
name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
uses: actions/setup-python@v5
- id: cz
name: Create bump and changelog
uses: commitizen-tools/commitizen-action@0.23.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
extra_requirements: "uv==${{ steps.uv.outputs.uv-version }}"
increment: ${{ inputs.increment }}
check_consistency: true
- name: Build package
run: uv build
- name: Release to GitHub
uses: softprops/action-gh-release@v2
with:
files: dist/*
tag_name: ${{ steps.cz.outputs.version }}
fail_on_unmatched_files: true
generate_release_notes: true
- name: Publish peprock 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
attestations: false
- name: Publish peprock 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build documentation
run: uv run pdoc --html peprock
- name: Upload documentation
uses: actions/upload-pages-artifact@v3
with:
path: "html/peprock"
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
- run: echo "🍏 This job's status is ${{ job.status }}."