From b26d1ba3d8e3550d31bc5bc84e6c9119aac2a036 Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Wed, 31 May 2023 22:36:38 -0500 Subject: [PATCH 1/2] CI: Use scientific-python/upload-nightly-action * Use the scientific-python/upload-nightly-action GitHub Action to upload the nightly wheels to the scientific-python-nightly-wheels Anaconda Cloud package index (https://anaconda.org/scientific-python-nightly-wheels). For security best practices pin at the commit sha corresponding to the last stable release and let Dependabot update the commit sha and comment as new releases come out. - c.f. https://github.com/scientific-python/upload-nightly-action --- .github/workflows/nightlies.yml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/workflows/nightlies.yml b/.github/workflows/nightlies.yml index f0ebd09d8236..812f22d01fa0 100644 --- a/.github/workflows/nightlies.yml +++ b/.github/workflows/nightlies.yml @@ -58,22 +58,11 @@ jobs: mv *.whl dist/ ls -l dist/ - # N.B. anaconda-client is only maintained on the main channel - - name: Install anaconda-client - uses: mamba-org/setup-micromamba@v1 - with: - environment-name: nightlies - create-args: anaconda-client=1.10.0 - condarc: | - channels: - - main - - name: Upload wheels to Anaconda Cloud as nightlies - run: | - anaconda --token ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }} upload \ - --user scientific-python-nightly-wheels \ - --skip-existing \ - dist/matplotlib-*.whl + uses: scientific-python/upload-nightly-action@8f0394fd2aa0c85d7364a9958652e8994e06b23c # 0.1.0 + with: + artifacts_path: dist + anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }} - name: Remove old uploads to save space run: | From fcb1008a7976cbaf1d76d2fa8b91f89bf85d406d Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Wed, 31 May 2023 22:42:48 -0500 Subject: [PATCH 2/2] MNT: Defer to Scientific Python org for upload removal * Remove the workflow step for querying and removing all but the last 5 nightly wheel uploads to the scientific-python-nightly-wheels Anaconda Cloud package index as this is now centrally done by the Scientific Python org for all projects that upload to https://anaconda.org/scientific-python-nightly-wheels. - c.f. https://github.com/scientific-python/upload-nightly-action/pull/12 --- .github/workflows/nightlies.yml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/.github/workflows/nightlies.yml b/.github/workflows/nightlies.yml index 812f22d01fa0..31d043f55819 100644 --- a/.github/workflows/nightlies.yml +++ b/.github/workflows/nightlies.yml @@ -63,22 +63,3 @@ jobs: with: artifacts_path: dist anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }} - - - name: Remove old uploads to save space - run: | - N_LATEST_UPLOADS=5 - - # Remove all _but_ the last "${N_LATEST_UPLOADS}" package versions - # N.B.: `anaconda show` places the newest packages at the bottom of - # the output of the 'Versions' section and package versions are - # preceded with a ' + '. - anaconda show scientific-python-nightly-wheels/matplotlib &> >(grep '+') | \ - sed 's/.* + //' | \ - head --lines "-${N_LATEST_UPLOADS}" > remove-package-versions.txt - - while LANG=C IFS= read -r package_version ; do - echo "Removing scientific-python-nightly-wheels/matplotlib/${package_version}" - anaconda --token ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }} remove \ - --force \ - "scientific-python-nightly-wheels/matplotlib/${package_version}" - done