Skip to content

JSONPyCraft v0.1.4

JSONPyCraft v0.1.4 #1

Workflow file for this run

name: Publish to PyPI
on:
release:
types:
- published
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
export PATH="$HOME/.poetry/bin:$PATH"
- name: Authenticate with PyPI
run: |
echo "//pypi.org/pypi/:username=\${{ secrets.PYPI_USERNAME }}" > ~/.pypirc
echo "//test.pypi.org/pypi/:username=\${{ secrets.PYPI_USERNAME }}" >> ~/.pypirc
- name: Build and publish
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry build
poetry publish --build
env:
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
- name: Build and publish to TestPyPI
run: |
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry config pypi-token.testpypi $TEST_PYPI_TOKEN
poetry build
poetry publish --build --repository testpypi
env:
TEST_PYPI_TOKEN: ${{ secrets.TEST_PYPI_TOKEN }}