Skip to content

Bump google-github-actions/auth from 2.1.0 to 2.1.1 #497

Bump google-github-actions/auth from 2.1.0 to 2.1.1

Bump google-github-actions/auth from 2.1.0 to 2.1.1 #497

name: Build and upload to PyPI
on:
pull_request:
push:
branches:
- 'main'
tags:
- 'v*'
release:
types:
- published
jobs:
build_artifacts:
name: Build artifacts
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: mamba-org/setup-micromamba@8767fb704bd78032e9392f0386bf46950bdd1194
with:
environment-file: environment.yml
- name: Build
shell: bash -l {0}
# It seems as though flit publish expects a .pypirc file as compared to
# only a token passed as an argument.
# See https://flit.pypa.io/en/latest/cmdline.html#flit-publish
run: |
flit build
- uses: actions/upload-artifact@v4
with:
path: dist/*
upload_pypi:
name: Upload to PyPI
needs: [build_artifacts]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@v1.8.11
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}