-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (39 loc) · 1.3 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
name: Release
on:
workflow_run:
workflows: [ "Release file check" ]
branches: [ master, main ]
types:
- completed
jobs:
deploy:
name: Deploy
environment: Deployment
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' && github.event.action == 'released' && github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install deps
run: |
python -m pip install pip --upgrade
python -m pip install poetry githubrelease httpx==0.18.2 autopub poetry
- name: Check if we should release
id: check_release
run: |
set +e
echo ::set-output name=release::$(autopub check)
- name: Publish
if: steps.check_release.outputs.release == ''
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: |
git remote set-url origin https://${{ secrets.BOT_TOKEN }}@github.com/${{ github.repository }}
autopub prepare
poetry build
autopub commit
poetry publish --username=__token__