-
Notifications
You must be signed in to change notification settings - Fork 2
71 lines (68 loc) · 2.19 KB
/
pypi.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
name: Pythonseer build and publish via label
on:
push:
branches:
- main
jobs:
build-n-publish:
name: Pythonseer build and publish
runs-on: ubuntu-latest
steps:
- name: "✔️ Checkout"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "📣 Release on push"
id: release
uses: rymndhng/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
bump_version_scheme: norelease
use_github_release_notes: true
- name: "✏️ Generate release changelog"
if: ${{ steps.release.outputs.version != '' }}
uses: heinrichreimer/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: "💾 Commit new version"
if: ${{ steps.release.outputs.version != '' }}
run: |
sed -i 's/^version = ".*"/version = "${{ steps.release.outputs.version }}"/g' ./pyproject.toml
git config user.email [email protected]
git config user.name github-actions
git commit -am 'version incremented'
git push
- name: "🐍 Set up Python 3.10"
if: ${{ steps.release.outputs.version != '' }}
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: "🛠 Install pypa/build"
if: ${{ steps.release.outputs.version != '' }}
run: >-
python -m
pip install
build
--user
- name: "🔧 Build a binary wheel and a source tarball"
if: ${{ steps.release.outputs.version != '' }}
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: "📦 Publish distribution to PyPI"
if: ${{ steps.release.outputs.version != '' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: "🤖 Announce on lemmy.dbzer0.com"
if: ${{ steps.release.outputs.version != '' }}
run: |
python -m pip install pythorhead
python .github/workflows/publish_on_lemmy.py ${{ steps.release.outputs.version }}
env:
LEMMY_BOT_PASSWORD: ${{ secrets.LEMMY_BOT_PASSWORD }}