Build distribution #106
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build distribution | |
on: | |
push: | |
paths-ignore: ['docs/**', '**.rst', '**.md'] | |
pull_request: | |
paths-ignore: ['docs/**', '**.rst', '**.md'] | |
workflow_dispatch: | |
schedule: | |
- cron: '0 6 * * 1' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install build dependencies | |
run: | | |
pip install --upgrade pip | |
pip install --upgrade build wheel setuptools | |
wget https://ccl.northwestern.edu/netlogo/6.3.0/NetLogo-6.3.0-64.tgz | |
tar -xzf NetLogo-6.3.0-64.tgz | |
- name: Build distributions | |
shell: bash -l {0} | |
run: python -m build | |
- name: Upload package as artifact to GitHub | |
if: github.repository == 'quaquel/pynetlogo' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: package | |
path: dist/ | |
- name: Publish package to PyPI | |
if: github.repository == 'quaquel/pynetlogo' && github.event_name =='push' && startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_password }} |