Skip to content

Define with openapi #94

Define with openapi

Define with openapi #94

Workflow file for this run

name: Publish package - pypi
on:
release:
types:
- published
push:
branches:
- develop
pull_request:
paths:
- "**.py"
- pyproject.toml
- requirements-dev.txt
- requirements.txt
- setup.cfg
- VERSION
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install -r requirements.txt
- name: Update TestPyPi VERSION
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }}
run: |
echo "$(cat VERSION).dev$(date +'%Y%m%d%H%M')" > VERSION
- name: Build
run: |
make build
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build-package
path: dist/*
pypi:
if: ${{ github.event_name == 'release' || github.event_name == 'push' }}
needs: setup
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/line-works-sdk/
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build-package
path: dist/
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
test-pypi:
if: ${{ github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }}
needs: setup
runs-on: ubuntu-latest
environment:
name: test-pypi
url: https://test.pypi.org/project/line-works-sdk/
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build-package
path: dist/
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
repository-url: https://test.pypi.org/legacy/