Skip to content

Commit

Permalink
Update pythonpublish
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGroundZero committed Jul 1, 2024
1 parent 6faa39c commit 8ec032f
Showing 1 changed file with 40 additions and 19 deletions.
59 changes: 40 additions & 19 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,50 @@ on:
release:
types: [created]

permissions:
contents: read

jobs:
build:
name: Build and upload to PyPI
release-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Build release distributions
run: |
python -m pip install build setuptools
python -m build
- name: Upload distributions
uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/

pypi-publish:
runs-on: ubuntu-latest

needs:
- release-build

permissions:
id-token: write
defaults:
run:
shell: python

environment:
name: pypi
url: https://pypi.org/p/OpenVAS-Reporting/

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build setuptools wheel twine
pip install -r requirements.txt
- name: Build and publish
run: |
python -m build .
- name: Publish package distributions to PyPI
name: release-dists
path: dist/

- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 8ec032f

Please sign in to comment.