-
Notifications
You must be signed in to change notification settings - Fork 9
Delete old releases #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+37
−0
Merged
Changes from 8 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1bc10af
[CI] : Temporarily build against forked torch-mlir to ensure CI build…
sahas3 15016d3
Merge branch 'llvm:main' into main
sahas3 7cdf9fd
[CI] : Delete old release assets due to GH policy of max 1000 assets …
sahas3 c245d99
[CI] : Fail CI if uploading artifacts fail.
sahas3 09578bc
Revert "[CI] : Temporarily build against forked torch-mlir to ensure …
sahas3 5d1fa67
Address feedback
sahas3 733d2c5
Update the check to consider name in addition to ID as well.
sahas3 a9e588b
Simplify asset find + delete logic
sahas3 b3da22b
Fix typo: reads -> read
sahas3 85aba77
Temporarily add a push trigger to try to run CI in forked repo.
sahas3 ad43652
Add explicit reference to github repo.
sahas3 7f9e2b1
Remove github token.
sahas3 fd41959
[revert] : Remove github token.
sahas3 93f14be
[revert] : Remove push trigger.
sahas3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,3 +71,4 @@ jobs: | |
| allowUpdates: true | ||
| replacesArtifacts: true | ||
| makeLatest: true | ||
| artifactErrorsFailBuild: true | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,3 +80,4 @@ jobs: | |
| allowUpdates: true | ||
| replacesArtifacts: true | ||
| makeLatest: true | ||
| artifactErrorsFailBuild: true | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: Delete Old Releases | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: '0 10 * * *' # Daily at 10:00 UTC which is 2:00 AM PST (UTC-8) | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| delete_release_assets: | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| contents: reads | ||
| packages: write | ||
| steps: | ||
| - name: Delete old release assets | ||
| # To use GitHub CLI in a GitHub Actions workflow, set the GH_TOKEN environment variable | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
sahas3 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # Don't run this in everyone's forks on schedule but allow to run via dispatch. | ||
| if: ${{ github.repository_owner == 'llvm' || github.event_name != 'schedule' }} | ||
| run: | | ||
|
|
||
| # Define 60 days in seconds (60 * 24 * 60 * 60 = 5184000) | ||
| 60_DAYS_IN_SECONDS=5184000 | ||
|
|
||
| # Find assets older than 60 days in the 'dev-wheels' release and pipe their names to xargs for deletion. | ||
| gh release view dev-wheels --json assets | \ | ||
| jq -r --argjson cutoff_seconds "$60_DAYS_IN_SECONDS" ' | ||
| (now - $cutoff_seconds) as $cutoff | | ||
| # Iterate over the assets in the single release | ||
| .assets[] | | ||
| # Select assets older than the cutoff | ||
| select((.createdAt | fromdateiso8601) < $cutoff) | | ||
| .name | ||
| ' | xargs -L1 gh release delete-asset dev-wheels | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.