-
Notifications
You must be signed in to change notification settings - Fork 19
92 lines (86 loc) · 2.79 KB
/
Copy pathpublish.yml
File metadata and controls
92 lines (86 loc) · 2.79 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
name: Publish
on:
release:
types:
- created
jobs:
update-version-and-changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Update version file
run: |
cat VERSION
echo "VERSION ${{ github.ref_name }}"
echo -n "${{ github.ref_name }}" > VERSION
- name: Update changelog file
run: |
echo "CHANGELOG"
- name: Commit updated files
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@users.noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git add VERSION CHANGELOG.md
git commit -m "Auto version and changelog update [${{ github.ref_name }}]"
git push origin
- name: Tag new commit
run: |
git tag --force ${{ github.ref_name }}
git push origin ${{ github.ref_name }} --force
update-release-github:
needs: update-version-and-changelog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Update Release description
run: |
echo "VERSION"
echo "CHANGELOG"
release-python-package:
needs: update-version-and-changelog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Build python package
run: |
python -m pip install wheel twine
python -m pip wheel . --no-deps --wheel-dir dist
twine upload -u __token__ -p ${{ secrets.PYPI_TOKEN }} dist/*
release-github-pages:
needs: update-version-and-changelog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-3.11-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'setup.cfg') }}-docs
restore-keys: |
${{ runner.os }}-python-3.11-
${{ runner.os }}-python-
${{ runner.os }}-
- name: Install dependencies
run: python -m pip install -e .[docs]
- name: Build and publish docs
run: |
git fetch --all
# lazydocs
python -m mkdocs build --config-file docs/mkdocs.yml
python -m mkdocs gh-deploy --config-file docs/mkdocs.yml --force