-
Notifications
You must be signed in to change notification settings - Fork 7
72 lines (60 loc) · 2.17 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
name: Publish release
on:
release:
types: [published]
permissions:
contents: write
jobs:
pypi:
name: Pypi release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run pre-release script
id: prerelease
run: ./scripts/pre-release.sh
- name: Build and publish
id: publish
uses: JRubics/[email protected]
if: steps.prerelease.conclusion == 'success'
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
ignore_dev_requirements: "yes"
- name: Send release webhook
if: steps.publish.conclusion == 'success'
run: |
VERSION=$(sed -rn 's/__version__: Final\[str\] = "(.*)"/\1/p' wom/__init__.py);
curl -X POST ${{ secrets.WOM_DISCORD_WEBHOOK_URL }} \
-H "Content-Type: application/json" \
-d '{
"username": "Automated Old Man",
"avatar_url": "https://jonxslays.github.io/wom.py/dev/wom-logo.png",
"embeds": [{
"color": 3447003,
"title": "wom.py v'$VERSION' has released to PyPI",
"description": "**Upgrade with**:\n```pip install -U wom.py=='$VERSION'```\n- [Changelog](https://github.com/Jonxslays/wom.py/blob/master/CHANGELOG.md)\n- [Repository](https://github.com/Jonxslays/wom.py)\n- [Python Package Index](https://pypi.org/project/wom-py)"
}]
}'
docs:
name: Stable docs release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install poetry
uses: Gr1N/setup-poetry@v8
- name: Install dependencies
run: |
pip install -U pip
poetry install
- name: Build and deploy
run: |
git config --global user.name "Jonxslays"
git config --global user.email "[email protected]"
git fetch origin gh-pages --depth=1
poetry run mike deploy --push --update-aliases $GITHUB_REF_NAME stable