forked from ijat/pritunl-api-python
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.16 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
name: Build the Package Release Assets
on:
release:
types: [released]
jobs:
build-package-and-release-assets:
permissions:
contents: write
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Setup Poetry and Configure PyPI
run: |
# Setup Poetry
pipx install poetry==1.8.2
# Configure PyPI Repository and Credentials
poetry config repositories.pypi ${{ secrets.PYPI_REPOSITORIES }}
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
- name: Build the Package
run: |
# Build the Package
poetry build --output ./dist
- name: Publish the Package to PyPI
run: |
# Publish the Package to PyPI
poetry publish --dist-dir ./dist --repository pypi
- name: Upload as Release Assets
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}