Skip to content

Automated deployment to PyPI on release #2

Automated deployment to PyPI on release

Automated deployment to PyPI on release #2

Workflow file for this run

name: Build and upload to PyPI
on:
push:
tags:
- "*"
release:
types:
- published
pull_request:
branches: [main]
env:
REPO_OWNER: MDAnalysis
REPO_NAME: PathSimAnalysis
PACKAGE_NAME: pathsimanalysis
jobs:
# Build the packacge and upload the resulting distribution
# as an artifact to later be used during deployment to
# PyPI
build:
name: "Build $PACKAGE_NAME"
if: github.repository == ${{ env.REPO_OWNER}}/${{ env.REPO_NAME }}

Check failure on line 26 in .github/workflows/deploy.yaml

View workflow run for this annotation

GitHub Actions / Build and upload to PyPI

Invalid workflow file

The workflow is not valid. .github/workflows/deploy.yaml (Line: 26, Col: 9): Unrecognized named-value: 'env'. Located at position 1 within expression: env.REPO_OWNER .github/workflows/deploy.yaml (Line: 60, Col: 9): Unrecognized named-value: 'env'. Located at position 1 within expression: env.REPO_OWNER
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build wheel and source
run: python3 -m build
- name: Upload distribution artifact
if: |
((github.event_name = 'push' && startsWith(github.ref, 'refs/tags/' )) ||
(github.event_name = 'release' && github.event.action == 'published')) &&
github.event_name != "pull_request"
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/
# Publish the resulting artifact from the above job to
# the main PyPI repository.
publish-to-pypi:
name: "Publish $PACKAGE_NAME to PyPI"
if: |
github.event_name == 'release' &&
github.event.action == 'published' &&
github.repository == ${{ env.REPO_OWNER }}/${{ env.REPO_NAME }} &&
github.event_name != "pull_request"
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: "https://pypi.org/p/$PACKAGE_NAME"
permissions:
id-token: write
steps:
- name: Downlaod build artifacts
uses: actions/download-artifacts@v3
with:
name: python-package-distributions
path: dist/
- name: "Publish $PACKAGE_NAME to PyPI"
uses: pypa/gh-action-pypi-publish@release/v1
publish-to-testpypi:
name: "Publish $PACKAGE_NAME to TestPyPI"
if: |
github.repository == ${{ env.REPO_OWNER }}/${{ env.REPO_NAME }} &&
github.event_name == 'push' &&
startsWith(github.ref, 'refs/tags/') &&
github.event_name != "pull_request"
needs:
- build
runs-on: ubuntu-latest
environment:
name: testpypi
url: "https://test.pypi.org/p/$PACKAGE_NAME"
permissions:
id-token: write
steps:
- name: Downlaod build artifacts
uses: actions/download-artifacts@v3
with:
name: python-package-distributions
path: dist/
- name: "Publish $PACKAGE_NAME to TestPyPI"
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip_existing: true