feat: automate releases.json updates via GitHub Actions workflow#171
Merged
Conversation
Adds .github/workflows/update-releases.yml that runs daily (and on workflow_dispatch) to detect new oras-project/oras releases and open a PR appending them to src/lib/data/releases.json with rebuilt dist/. The companion script .github/scripts/update-releases.mjs handles discovery and checksum parsing. It supports two modes: - No args: auto-detect via the GitHub releases API, only adding versions strictly newer than the current max in releases.json. - Explicit version args: backfill specific versions (useful when a release was missed). Closes #168. Signed-off-by: Terry Howe <terrylhowe@gmail.com>
bdaf65b to
9960d38
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
.github/workflows/update-releases.yml— runs daily at 06:00 UTC and onworkflow_dispatch. Detects neworas-project/orasreleases that aren't yet insrc/lib/data/releases.json, appends them, rebuildsdist/, and opens a PR viapeter-evans/create-pull-request..github/scripts/update-releases.mjs— the underlying Node script. Two modes:releases.json, so older 0.x releases the project intentionally never tracked are not backfilled.node .github/scripts/update-releases.mjs 1.3.2 1.3.3): adds the specific versions, useful for catching up if a scheduled run was missed. Wired through theworkflow_dispatchversioninput.The script downloads the upstream
oras_<version>_checksums.txt, parses the lines, and writes entries that match the existing schema ({platform: {arch: {checksum, url}}}). Missing/404 checksum files cause a non-zero exit before any write, so a partial file is never persisted. Auto runs that find nothing exit silently.The PR opened by the workflow is created with
GITHUB_TOKEN, which means follow-up CI (Tests,Check dist/) will not auto-trigger on it — a maintainer needs to push an empty commit or close/reopen to kick CI. If that friction becomes a pain we can swap to a PAT or GitHub App token in a follow-up.Closes #168. Refs #166, #167.
Test plan
node .github/scripts/update-releases.mjs— no-op when current max (1.3.2) matches upstreamnode .github/scripts/update-releases.mjs 1.3.2— no-op for already-present versionnode .github/scripts/update-releases.mjs 0.16.0— successfully fetches checksums and inserts entry in semver order (then reverted locally)npm run build— passes, no dist driftversion: 1.3.0(already present) to confirm graceful skip