Skip to content

Commit

Permalink
Merge pull request #5294 from cwisniew/purge-old-nightlies
Browse files Browse the repository at this point in the history
Add logic to delete old nightly builds and tags
  • Loading branch information
kwvanderlinde authored Mar 9, 2025
2 parents 858857f + 304deca commit fc33154
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/nightly-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Nightly Release

on:
schedule:
- cron: '13 2 * * *' # Odd time so that it doesn't run afoul of busy periods everyone picks
- cron: '13 2 * * *' # Odd time so that it doesn't run afoul of busy periods everyone picks

jobs:
build:
Expand All @@ -23,3 +23,9 @@ jobs:
GITHUB_TOKEN: ${{ secrets.NIGHTLY_BUILD_GH_TOKEN }}
run: |
gh release create nightly-${NIGHTLY_DATE} -R ${{github.repository}} --title "MapTool Nightly ${NIGHTLY_DATE}" --notes "MapTool Nightly Build for ${NIGHTLY_DATE}" --generate-notes -p --target develop
- name: Delete old Nightly releases
id: delete-old
env:
GITHUB_TOKEN: ${{ secrets.NIGHTLY_BUILD_GH_TOKEN }}
run: |
gh release list -R ${{ github.repository }} --json 'name,tagName' --jq '.[] | select(.tagName | startswith("nightly"))|.tagName' | tail +2 | xargs -n 1 gh release delete -R ${{ github.repository}} -y --cleanup-tag

0 comments on commit fc33154

Please sign in to comment.