-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
276 additions
and
45 deletions.
There are no files selected for viewing
This file contains 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,16 @@ | ||
{ | ||
"categories": [ | ||
{ | ||
"title": "## Features", | ||
"labels": ["T-feature"] | ||
}, | ||
{ | ||
"title": "## Fixes", | ||
"labels": ["T-bug", "T-fix"] | ||
} | ||
], | ||
"ignore_labels": ["L-ignore"], | ||
"template": "${{CHANGELOG}}\n## Other\n\n${{UNCATEGORIZED}}", | ||
"pr_template": "- ${{TITLE}} (#${{NUMBER}})", | ||
"empty_template": "- No changes" | ||
} |
This file contains 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,14 @@ | ||
module.exports = async ({ github, context }, tagName) => { | ||
try { | ||
await github.rest.git.createRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: `refs/tags/${tagName}`, | ||
sha: context.sha, | ||
force: true, | ||
}); | ||
} catch (err) { | ||
console.error(`Failed to create tag: ${tagName}`); | ||
console.error(err); | ||
} | ||
}; |
This file contains 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,15 @@ | ||
module.exports = async ({ github, context }, tagName) => { | ||
try { | ||
await github.rest.git.updateRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: `tags/${tagName}`, | ||
sha: context.sha, | ||
force: true, | ||
}); | ||
} catch (err) { | ||
console.error(`Failed to move nightly tag.`); | ||
console.error(`This should only happen the first time.`); | ||
console.error(err); | ||
} | ||
}; |
This file contains 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,39 @@ | ||
module.exports = async ({ github, context }) => { | ||
console.log("Pruning old prereleases"); | ||
|
||
// doc: https://docs.github.com/en/rest/releases/releases | ||
const { data: releases } = await github.rest.repos.listReleases({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
}); | ||
|
||
let nightlies = releases.filter( | ||
release => | ||
// Only consider releases tagged `nightly-${SHA}` for deletion | ||
release.tag_name.includes("nightly") && | ||
release.tag_name !== "nightly" && | ||
// ref: https://github.com/foundry-rs/foundry/issues/3881 | ||
// Skipping pruning the build on 1st day of each month | ||
!release.created_at.includes("-01T") | ||
); | ||
|
||
// Keep newest 3 nightlies | ||
nightlies = nightlies.slice(3); | ||
|
||
for (const nightly of nightlies) { | ||
console.log(`Deleting nightly: ${nightly.tag_name}`); | ||
await github.rest.repos.deleteRelease({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
release_id: nightly.id, | ||
}); | ||
console.log(`Deleting nightly tag: ${nightly.tag_name}`); | ||
await github.rest.git.deleteRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: `tags/${nightly.tag_name}`, | ||
}); | ||
} | ||
|
||
console.log("Done."); | ||
}; |
This file contains 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