-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (46 loc) · 1.43 KB
/
publish-release-to-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
---
name: Publish release to PyPI
on:
release:
types: [released]
env:
TOKEN: ${{ secrets.GH_TOKEN }}
# API tokens require username "__token__".
# Repo names other than pypi.org must be configured with:
# % poetry config repositories.testpypi https://test.pypi.org/legacy/
# and the env vars must be named accordingly:
# - POETRY_HTTP_BASIC_<REPO>_USERNAME
# - POETRY_PYPI_TOKEN_<REPO>
POETRY_HTTP_BASIC_PYPI_USERNAME: __token__
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_DASCHBOT_TOKEN }}
jobs:
publish-release-to-pypi:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry install
- name: build wheel
run: |
rm -rf dist/ build/
poetry build
- name: publish new version to PyPI
run: poetry publish
notification:
name: Google chat notification about release and published version
needs: [publish-release-to-pypi]
runs-on: ubuntu-latest
steps:
- name: Send notification to google chat room "DSP releases"
uses: lakto/google-chat-action@main
with:
url: ${{ secrets.GOOGLE_CHAT_DSP_RELEASES_WEBHOOK_URL }}