Skip to content

Commit

Permalink
Merge pull request #37 from nathanielvarona/automation/package-releases
Browse files Browse the repository at this point in the history
Package Build/Publish to PyPI and Upload Release Assets
  • Loading branch information
nathanielvarona committed Apr 26, 2024
2 parents 27a601b + a744406 commit f58df39
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 6 deletions.
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

0 comments on commit f58df39

Please sign in to comment.