Skip to content

Delete old nightlies #109

Delete old nightlies

Delete old nightlies #109

name: Delete old nightlies
on:
schedule:
- cron: "36 0 * * *" # Every day
workflow_dispatch:
inputs:
TILEDB_CI_ACCOUNT:
description: >-
(string) The main account/channel on anaconda.org. The actual channel
to be searched will be "TILEDB_CI_ACCOUNT/label/nightlies"
required: true
default: "tiledb"
TILEDB_CI_DAYS:
description: >-
(integer) Number of days to keep nightlies (ie nightlies uploaded more
than $TILEDB_CI_DAYS days ago will be removed)
required: true
default: 7
TILEDB_CI_DRY_RUN:
description: >-
(integer) Exit without actually removing packages. Default is 0. Set
to 1 for dry run
default: 0
defaults:
run:
shell: bash -l {0}
env:
TILEDB_CI_ACCOUNT: ${{ github.event.inputs.TILEDB_CI_ACCOUNT || 'tiledb' }}
TILEDB_CI_DAYS: ${{ github.event.inputs.TILEDB_CI_DAYS || 7 }}
TILEDB_CI_DRY_RUN: ${{ github.event.inputs.TILEDB_CI_DRY_RUN || 0 }}
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
jobs:
remove:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup conda env
uses: mamba-org/setup-micromamba@v1
with:
environment-file: scripts/delete-old-nightlies.yml
cache-environment: true
- name: Confirm anaconda.org API token is valid
run: anaconda --token "$ANACONDA_TOKEN" whoami
- name: Remove old nightlies
run: |
for subdir in linux-64 linux-aarch64 linux-ppc64le osx-64 osx-arm64 win-64
do
TILEDB_CI_SUBDIR="$subdir" bash scripts/delete-old-nightlies.sh
sleep 1
done
issue:
permissions:
issues: write
runs-on: ubuntu-latest
needs: remove
if: ( failure() || cancelled() ) && github.repository_owner == 'TileDB-Inc' && github.event_name == 'schedule'
steps:
- uses: actions/checkout@v4
- name: Open Issue
uses: TileDB-Inc/github-actions/open-issue@main
with:
name: delete old nightlies
label: bug,scheduled,delete-old-nightlies
assignee: shaunrd0,ihnorton,jdblischak
env:
TZ: "America/New_York"