CD #496
This file contains hidden or 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: CD | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
release: | |
types: | |
- published | |
schedule: | |
- cron: "34 5 * * *" | |
permissions: | |
actions: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
dist: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: hynek/build-and-inspect-python-package@v2 | |
publish: | |
needs: [dist] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' && github.event.action == 'published' | |
environment: | |
name: pypi | |
url: https://pypi.org/p/hist | |
permissions: | |
id-token: write | |
attestations: write | |
contents: read | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: Packages | |
path: dist | |
- name: Generate artifact attestation for sdist and wheel | |
uses: actions/attest-build-provenance@v2 | |
with: | |
subject-path: "dist/hist-*" | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
upload_nightly_wheels: | |
name: Upload nightly wheels to Anaconda Cloud | |
if: | | |
(github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && | |
!github.event.repository.fork && | |
github.ref == 'refs/heads/main' | |
needs: [dist] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: Packages | |
path: dist | |
- name: List all files | |
run: ls -lh dist | |
- name: Upload wheel to Anaconda Cloud as nightly | |
uses: scientific-python/upload-nightly-action@b36e8c0c10dbcfd2e05bf95f17ef8c14fd708dbf # 0.6.2 | |
with: | |
artifacts_path: dist | |
anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }} |