-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (49 loc) · 1.48 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
# Adapted from https://github.com/python-poetry/poetry/blob/master/.github/workflows/release.yml
name: Release
on:
push:
branches:
- main
jobs:
release-please:
name: release-please
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: GoogleCloudPlatform/release-please-action@v3
id: release
with:
release-type: python
package-name: rstr-client
publish:
name: publish
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install Poetry
run: |
pip install poetry
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Check Version
id: check-version
env:
TAG_NAME: ${{ needs.release-please.outputs.tag_name }}
run: |
[[ v"$(poetry version --short)" = "$TAG_NAME" ]] \
|| (echo "version does not match tag" && exit 1)
- name: Build project for distribution
run: poetry build
- name: Publish to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: |
poetry publish -u __token__ -p $POETRY_PYPI_TOKEN_PYPI