Skip to content

cd

cd #64

Workflow file for this run

name: cd
permissions:
contents: read
on: # yamllint disable-line rule:truthy
workflow_dispatch:
inputs:
mpiname:
description: 'MPI Name'
required: false
type: choice
default: 'mpich'
options:
- mpich
- openmpi
version:
description: 'MPI Version'
required: false
type: string
default: ''
release:
description: 'Release number'
required: false
type: string
default: ''
os-arch:
description: 'Target OS-Architecture'
required: false
type: choice
default: '*'
options:
- '*'
- Linux
- Linux-aarch64
- Linux-x86_64
- macOS
- macOS-arm64
- macOS-x86_64
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:
wheel:
uses: ./.github/workflows/cd-wheel.yml
with:
mpiname: ${{ inputs.mpiname }}
version: ${{ inputs.version }}
release: ${{ inputs.release }}
os-arch: ${{ inputs.os-arch }}
publish-pypi:
if: ${{ inputs.publish-pypi }}
runs-on: ubuntu-latest
needs: wheel
environment:
name: pypi
url: https://pypi.org/project/${{ inputs.mpiname }}/
permissions:
contents: read
id-token: write
attestations: write
steps:
- uses: step-security/harden-runner@v2
with:
egress-policy: audit
- 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 wheel artifacts
uses: actions/attest-build-provenance@v2
with:
subject-path: dist/*.whl
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
publish-testpypi:
if: ${{ inputs.publish-testpypi }}
runs-on: ubuntu-latest
needs: wheel
environment:
name: testpypi
url: https://test.pypi.org/project/${{ inputs.mpiname }}/
permissions:
contents: read
id-token: write
steps:
- uses: step-security/harden-runner@v2
with:
egress-policy: audit
- 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 }}
needs: wheel
runs-on: ubuntu-latest
environment:
name: anaconda
url: https://anaconda.org/mpi4py/${{ inputs.mpiname }}
steps:
- uses: step-security/harden-runner@v2
with:
egress-policy: audit
- 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: 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/*.whl
env:
ANACONDA_USER: mpi4py
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
shell: bash -el {0}