-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (50 loc) · 1.51 KB
/
publish.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
name: Upload Python Package
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
release:
name: Create Release
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Build Changelog
id: github_release
uses: mikepenz/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
body: ${{steps.github_release.outputs.changelog}}
draft: false
prerelease: false
deploy:
needs: release
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install Python Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.2.2
- name: View poetry version
run: poetry --version
- name: Install dependencies
run: |
python -m poetry install
- name: Build and publish
env:
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
poetry publish --build --username "${PYPI_USERNAME}" --password "${PYPI_PASSWORD}"