From c1bf9ac5b55a0b6e2e3af79e91dde548bf914277 Mon Sep 17 00:00:00 2001 From: Yevhenii Havrylko Date: Mon, 16 Oct 2023 16:22:41 -0400 Subject: [PATCH] Add clean up job (#1593) Co-authored-by: Anton <100830759+antonwolfy@users.noreply.github.com> --- .github/workflows/conda-package.yml | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index c0e5746b504..985ccc83e78 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -401,3 +401,33 @@ jobs: run: anaconda --token ${{ env.ANACONDA_TOKEN }} upload --user dppy --label dev ${{ env.PACKAGE_NAME }}-*.tar.bz2 env: ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }} + + cleanup_packages: + name: Clean up anaconda packages + needs: [upload] + runs-on: 'ubuntu-latest' + defaults: + run: + shell: bash -el {0} + steps: + - uses: conda-incubator/setup-miniconda@v2 + with: + run-post: false + channel-priority: "disabled" + channels: conda-forge + python-version: '3.11' + + - name: Install anaconda-client + run: conda install anaconda-client + + - name: Checkout repo + uses: actions/checkout@v2 + with: + repository: IntelPython/devops-tools + fetch-depth: 0 + + - name: Cleanup old packages + run: | + python scripts/cleanup-old-packages.py \ + --verbose --force --token ${{ secrets.ANACONDA_TOKEN }} \ + --package dppy/${{ env.PACKAGE_NAME }} --label dev