Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package Build/Publish to PyPI and Upload Release Assets #37

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ charset = utf-8
indent_style = space
indent_size = 4

# Tab indentation (no size specified)
[Makefile]
indent_style = tab
# YAML files
[*.{yaml,yml}]
indent_style = space
indent_size = 2

# YAML files
[*.{md}]
indent_style = space
indent_size = 2
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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 --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 }}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Before using the API library including the use of the CLI feature, we need to pr

```bash
export PRITUNL_BASE_URL="https://vpn.domain.tld/"
export PRITUNL_API_TOKEN="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
export PRITUNL_API_SECRET="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
export PRITUNL_API_TOKEN="<PRITUNL API TOKEN>"
export PRITUNL_API_SECRET="<PRITUNL API SECRET>"
```

Initializing an API Instance.
Expand All @@ -42,7 +42,7 @@ pritunl = Pritunl()

## You can also initialize an instance by manually providing the arguments.
# pritunl = Pritunl(
# url="<PRITUNL API URL>",
# url="<PRITUNL BASE URL>",
# token="<PRITUNL API TOKEN>",
# secret="<PRITUNL API SECRET>"
# )
Expand Down