Skip to content

cd

cd #179

Workflow file for this run

name: cd
permissions:
contents: read
on: # yamllint disable-line rule:truthy
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
inputs:
repository:
description: 'mpi4py repository'
default: mpi4py/mpi4py
required: true
type: string
ref:
description: 'mpi4py ref'
default: ''
required: false
type: string
publish-pypi:
description: 'Publish to PyPI'
required: false
type: boolean
default: false
publish-testpypi:
description: 'Publish to TestPyPI'
required: false
type: boolean
default: false
publish-anaconda:
description: 'Publish to Anaconda'
required: false
type: boolean
default: false
jobs:
docs:
uses: ./.github/workflows/cd-docs.yml
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
sdist:
uses: ./.github/workflows/cd-sdist.yml
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
wheel-Linux:
uses: ./.github/workflows/cd-wheel.yml
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
os-arch: Linux
wheel-macOS:
uses: ./.github/workflows/cd-wheel.yml
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
os-arch: macOS
wheel-Windows:
uses: ./.github/workflows/cd-wheel.yml
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
os-arch: Windows
publish-pypi:
if: ${{ inputs.publish-pypi }}
runs-on: ubuntu-latest
needs:
- sdist
- wheel-Linux
- wheel-macOS
- wheel-Windows
environment:
name: pypi
url: https://pypi.org/project/mpi4py
permissions:
contents: read
id-token: write
attestations: write
steps:
- uses: step-security/harden-runner@v2
with:
egress-policy: audit
- name: Download sdist artifact
uses: actions/download-artifact@v4
with:
path: dist
pattern: sdist
merge-multiple: true
- name: Download wheel artifacts
uses: actions/download-artifact@v4
with:
path: dist
pattern: wheel-*
merge-multiple: true
- name: Report sha256sum
run: |
# Report sha256sum
echo '```' >> "$GITHUB_STEP_SUMMARY"
sha256sum -b *.whl >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
working-directory: dist
- name: Attest artifacts
uses: actions/attest-build-provenance@v2
with:
subject-path: dist/*
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
publish-testpypi:
if: ${{ inputs.publish-testpypi }}
runs-on: ubuntu-latest
needs:
- sdist
- wheel-Linux
- wheel-macOS
- wheel-Windows
environment:
name: testpypi
url: https://test.pypi.org/project/mpi4py
permissions:
contents: read
id-token: write
steps:
- uses: step-security/harden-runner@v2
with:
egress-policy: audit
- name: Download sdist artifact
uses: actions/download-artifact@v4
with:
path: dist
pattern: sdist
merge-multiple: true
- name: Download wheel artifacts
uses: actions/download-artifact@v4
with:
path: dist
pattern: wheel-*
merge-multiple: true
- name: Report sha256sum
run: |
# Report sha256sum
echo '```' >> "$GITHUB_STEP_SUMMARY"
sha256sum -b *.whl >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
working-directory: dist
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
publish-anaconda:
if: |
inputs.publish-anaconda ||
github.event_name == 'schedule'
needs:
- sdist
- wheel-Linux
- wheel-macOS
- wheel-Windows
runs-on: ubuntu-latest
environment:
name: anaconda
url: https://anaconda.org/mpi4py/mpi4py
steps:
- uses: step-security/harden-runner@v2
with:
egress-policy: audit
- name: Download sdist artifact
uses: actions/download-artifact@v4
with:
path: dist
pattern: sdist
merge-multiple: true
- name: Download wheel artifacts
uses: actions/download-artifact@v4
with:
path: dist
pattern: wheel-*
merge-multiple: true
- name: Report sha256sum
run: |
# Report sha256sum
echo '```' >> $GITHUB_STEP_SUMMARY
sha256sum -b *.tar.gz >> $GITHUB_STEP_SUMMARY
sha256sum -b *.whl >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
working-directory: dist
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v2
with:
environment-name: ac
create-args: anaconda-client
- name: Publish to Anaconda
run: |
# https://pypi.anaconda.org/mpi4py/simple
anaconda --token "$ANACONDA_TOKEN" \
upload --user "$ANACONDA_USER" --force \
dist/*.tar.gz dist/*.whl
env:
ANACONDA_USER: mpi4py
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
shell: bash -el {0}