diff --git a/.github/workflows/Benchmarks.yml b/.github/workflows/Benchmarks.yml index 88d5aad03..4f412349b 100644 --- a/.github/workflows/Benchmarks.yml +++ b/.github/workflows/Benchmarks.yml @@ -66,3 +66,4 @@ jobs: name: benchmarks_${{runner.os}}_${{matrix.hypervisor}}_${{ matrix.cpu }} path: ./target/criterion/ if-no-files-found: error + retention-days: 5 diff --git a/.github/workflows/CleanUpReleasesAndPackages.yml b/.github/workflows/CleanUpReleasesAndPackages.yml deleted file mode 100644 index 22b9badd6..000000000 --- a/.github/workflows/CleanUpReleasesAndPackages.yml +++ /dev/null @@ -1,36 +0,0 @@ -# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json - -# This job cleans up old pre-releases and pre-releases packages retaining the last 40 versions - -name: Clean up old pre-releases and packages and artifacts -on: - schedule: - - cron: "0 8 * * 1" # run at 8am every Monday - workflow_dispatch: # allow manual triggering - -jobs: - cleanup: - name: Clean up old pre-releases and packages - runs-on: ubuntu-latest - permissions: - actions: write # required for reading & deleting github actions artifacts - contents: write # required for reading and deleting releases - - steps: - - - name: Delete old 'Hyperlight' releases - uses: sgpublic/delete-release-action@v1.2 - with: - pre-release-drop: true - pre-release-keep-count: 5 - pre-release-drop-tag: true - draft-drop: false - env: - GITHUB_TOKEN: ${{ github.token }} - - - uses: actions/checkout@v6 - - - name: Delete old Github Actions Artifacts - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: ./dev/clean-github-artifacts.sh diff --git a/.github/workflows/dep_fuzzing.yml b/.github/workflows/dep_fuzzing.yml index 456e1f405..8b2bf8557 100644 --- a/.github/workflows/dep_fuzzing.yml +++ b/.github/workflows/dep_fuzzing.yml @@ -56,3 +56,4 @@ jobs: with: name: fuzz-crash-artifacts path: fuzz/artifacts/ + retention-days: 28 diff --git a/dev/clean-github-artifacts.sh b/dev/clean-github-artifacts.sh deleted file mode 100755 index d344ce0ae..000000000 --- a/dev/clean-github-artifacts.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -# Cleans up artifacts older than 7 days, except for release artifacts. - -set -o errexit -set -o nounset -set -o pipefail - -CUTOFF_DATE=$(date --date='7 days ago' +%s) # the cutoff up to which we delete artifacts -echo "Querying for artifacts older than $(date --date="@$CUTOFF_DATE")..." - -# gets artifacts and writes them to a file in the format , -gh api repos/hyperlight-dev/hyperlight/actions/artifacts?per_page=100 --paginate | - jq -crs --arg date "$CUTOFF_DATE" 'map(.artifacts) | - flatten | .[] | - select((.created_at | fromdate) < ($date | tonumber) and (.workflow_run.head_branch | test("(release/)?v\\d+\\.\\d+\\.\\d+") | not)) | - "\(.id),\(.size_in_bytes)"' > HYPERLIGHT_ARTIFACTS_TO_DELETE.txt -awk -F',' '{ sum += $2 }END{ printf "Deleting %d artifacts taking up %d bytes.\n", NR, sum }' HYPERLIGHT_ARTIFACTS_TO_DELETE.txt -# deletes each artifact in the file -cut -d "," -f 1 < HYPERLIGHT_ARTIFACTS_TO_DELETE.txt | xargs -I{} gh api --method DELETE /repos/hyperlight-dev/hyperlight/actions/artifacts/{} -rm -f HYPERLIGHT_ARTIFACTS_TO_DELETE.txt -echo "Deletion complete."