Skip to content

Merge branch 'develop' of github.com:NREL/pCrunch into develop #52

Merge branch 'develop' of github.com:NREL/pCrunch into develop

Merge branch 'develop' of github.com:NREL/pCrunch into develop #52

name: Build and upload to PyPI
# Build on every branch push, tag push, and pull request change:
#on: [push, pull_request]
# Alternatively, to publish when a (published) GitHub Release is created, use the following:
on:
push:
pull_request:
release:
types:
- published
jobs:
build_and_upload_pypi:
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
#if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
# alternatively, to publish when a GitHub Release is created, use the following rule:
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
id: cp
with:
python-version: "3.11"
update-environment: true
- name: Install pypa/build
run: |
'${{ steps.cp.outputs.python-path }}' -m pip install build
- name: Build a binary wheel and a source tarball
run: |
'${{ steps.cp.outputs.python-path }}' -m build .
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
# To test: repository_url: https://test.pypi.org/legacy/