Skip to content

Merge pull request #47 from opalsecurity/fix/create-github-release-on… #14

Merge pull request #47 from opalsecurity/fix/create-github-release-on…

Merge pull request #47 from opalsecurity/fix/create-github-release-on… #14

name: Publish to PyPI
on:
push:
tags:
- 'v*'
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build twine setuptools_scm
- name: Build the package
run: |
python -m build
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_ACCESS_TOKEN }}
run: |
python -m twine upload dist/*
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: gh release create "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --title "$GITHUB_REF_NAME" --generate-notes