Skip to content

Feature/add inventoty v3 support #65

Feature/add inventoty v3 support

Feature/add inventoty v3 support #65

Workflow file for this run

# https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Upload Python Package
on:
release:
types: [published]
pull_request:
types:
- closed
jobs:
create-github-release:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Extract version from prismacloud/cli/version.py
run: |
version=$(grep 'version = ' prismacloud/api/version.py | sed -E "s/version = \"([^\"]+)\"/\1/")
echo "PRISMA_CLOUD_API_VERSION=$version" >> $GITHUB_ENV
- name: Create GitHub Release
run: |
gh release create ${{ env.PRISMA_CLOUD_API_VERSION }} --generate-notes --latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
deploy:
runs-on: ubuntu-latest
needs:
- create-github-release
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install pylint
pip install -r requirements.txt
- name: Test API
run: |
pylint prismacloud/api
- name: Build
run: |
python -m build
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}