-
-
Notifications
You must be signed in to change notification settings - Fork 399
79 lines (67 loc) · 2.04 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
name: Release
on:
push:
tags:
- "*"
jobs:
release-pypi:
name: release-pypi
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Check prerelease
id: check_version
run: |
if [[ "${{ github.ref }}" =~ ^refs/tags/[0-9.]+$ ]]; then
echo "PRERELEASE=false" >> $GITHUB_OUTPUT
else
echo "PRERELEASE=true" >> $GITHUB_OUTPUT
fi
- name: Build artifacts
run: |
python -m pip install build
python -m build
- name: Test Build
run: |
python -m pip install dist/*.whl
pdm --help
- name: Build Release Docs
run: |
pdm install -G doc
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git fetch origin gh-pages:gh-pages
tag="${{ github.ref_name }}"
DOC_VERSION=${tag%.*}
cd docs
pdm run mike deploy --no-redirect --update-aliases "$DOC_VERSION" latest
git push origin gh-pages
- name: Publish package distributions to PyPI
run: pdm publish --no-build
- name: Get Changelog
id: get-changelog
run: |
awk '/-{3,}/{flag=1;next}/Release/{if (flag==1)exit}flag' CHANGELOG.md > .changelog.md
- name: Create Release
uses: actions/create-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: v${{ github.ref }}
body_path: .changelog.md
draft: false
prerelease: ${{ steps.check_version.outputs.PRERELEASE }}
- name: Trigger Bucket Update
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Excavator
repo: frostming/scoop-frostming
token: ${{ secrets.G_T }}
ref: master