File: nightlies.yml

package info (click to toggle)
matplotlib 3.10.7%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 72,820 kB
  • sloc: python: 147,545; cpp: 62,988; objc: 1,679; ansic: 1,426; javascript: 788; makefile: 92; sh: 53
file content (65 lines) | stat: -rw-r--r-- 2,298 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
name: Upload nightly wheels to Anaconda Cloud

on:
  # Run daily at 1:23 UTC to upload nightly wheels to Anaconda Cloud
  schedule:
    - cron: '23 1 * * *'
  # Run on demand with workflow dispatch
  workflow_dispatch:

permissions:
  actions: read

jobs:
  upload_nightly_wheels:
    name: Upload nightly wheels to Anaconda Cloud
    runs-on: ubuntu-latest
    defaults:
      run:
        # The login shell is necessary for the setup-micromamba setup
        # to work in subsequent jobs.
        # https://github.com/mamba-org/setup-micromamba#about-login-shells
        shell: bash -e -l {0}
    if: github.repository_owner == 'matplotlib'

    steps:
      # https://github.com/actions/download-artifact/issues/3#issuecomment-1017141067
      - name: Download wheel artifacts from last build on 'main'
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          PROJECT_REPO="matplotlib/matplotlib"
          BRANCH="main"
          WORKFLOW_NAME="cibuildwheel.yml"
          ARTIFACT_PATTERN="cibw-wheels-*"

          gh run --repo "${PROJECT_REPO}" \
             list --branch "${BRANCH}" \
                  --workflow "${WORKFLOW_NAME}" \
                  --json event,status,conclusion,databaseId > runs.json
          RUN_ID=$(
            jq --compact-output \
              '[
                .[] |
                # Filter on "push" events to main (merged PRs) ...
                select(.event == "push") |
                # that have completed successfully ...
                select(.status == "completed" and .conclusion == "success")
               ] |
              # and get ID of latest build of wheels.
              sort_by(.databaseId) | reverse | .[0].databaseId' runs.json
          )
          gh run --repo "${PROJECT_REPO}" view "${RUN_ID}"
          gh run --repo "${PROJECT_REPO}" \
             download "${RUN_ID}" --pattern "${ARTIFACT_PATTERN}"

          mkdir dist
          mv ${ARTIFACT_PATTERN}/*.whl dist/
          ls -l dist/

      - name: Upload wheels to Anaconda Cloud as nightlies
        uses: scientific-python/upload-nightly-action@82396a2ed4269ba06c6b2988bb4fd568ef3c3d6b  # 0.6.1
        with:
          artifacts_path: dist
          anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }}