Bump actions/download-artifact from 3 to 4 #26
Workflow file for this run
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 and publish to TestPyPI or PyPI | |
on: [push, pull_request] | |
jobs: | |
get_python_versions: | |
name: "Determine Python versions" | |
runs-on: ubuntu-latest | |
outputs: | |
min-python: ${{ steps.nep29.outputs.min-python }} | |
max-python: ${{ steps.nep29.outputs.max-python }} | |
steps: | |
- name: "calculate versions according to NEP29" | |
id: nep29 | |
uses: mstimberg/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
build: | |
needs: [get_python_versions] | |
name: Build π‘ and source π¦ | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # we need the full history for the version calculation | |
- name: Set up Python 3.x | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Build source tarball and noarch wheel | |
run: | | |
python -m pip install --upgrade pip build wheel | |
python -m build | |
- name: store distribution π¦ | |
uses: actions/upload-artifact@v3 | |
with: | |
name: packages | |
path: dist | |
deploy_dev: | |
name: Publish development π¦ to TestPyPI | |
runs-on: ubuntu-latest | |
if: github.repository == 'brian-team/brian2genn' && github.ref == 'refs/heads/master' | |
environment: development_release | |
permissions: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | |
needs: | |
- build | |
steps: | |
- name: load distribution π¦ | |
uses: actions/download-artifact@v4 | |
with: | |
name: packages | |
path: dist/ | |
- name: Publish distribution π¦ to Test PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
deploy: | |
name: Publish release π¦ to PyPI | |
runs-on: ubuntu-latest | |
if: github.repository == 'brian-team/brian2genn' && startsWith(github.ref, 'refs/tags') | |
environment: release | |
permissions: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | |
needs: | |
- build | |
steps: | |
- name: load distribution π¦ | |
uses: actions/download-artifact@v4 | |
with: | |
name: packages | |
path: dist/ | |
- name: Publish distribution release π¦ to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |