-
Notifications
You must be signed in to change notification settings - Fork 12
chore(ci): add automated dated release workflow #333
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
imshashank
merged 21 commits into
Noveum:main
from
Andes-indica:ci/auto-release-workflow
Aug 25, 2026
Merged
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
5e3c574
chore(ci):add automated dated release workflow
Andes-indica 282c579
updated docs
Andes-indica 941706e
chore(ci): fix release workflow f-string and update docs
Andes-indica 10892c7
ci: add workflow_dispatch to auto-release for manual testing
Andes-indica 2b95956
ci: fix release step GITHUB_TOKEN and use
Andes-indica 97095c0
ci: pin actions/checkout to full commit SHA
Andes-indica 1f4024b
ci: auto-release - migrate notes to Bun TS, fix lint/format; adjust w…
Andes-indica 877f28c
ci(workflows): pin oven-sh/setup-bun v2 to commit SHA in auto-release…
Andes-indica a1a0719
ci:resolved since-declaration causing the test error
Andes-indica 337fb92
ci:resolved tag format error
Andes-indica b8f6fc3
ci:fix release retry boundary and orphan tag handling
Andes-indica fa29954
fix release retry and orphan tag recovery
Andes-indica 7ecc729
Merge branch 'Noveum:main' into ci/auto-release-workflow
Andes-indica 7585b19
ci:fix automated release workflow contract
Andes-indica 2517e9f
Merge branch 'Noveum:main' into ci/auto-release-workflow
Andes-indica 9cb3df4
fix release workflow orphan recovery
Andes-indica a3021d3
fix automated release workflow wiring
Andes-indica 6d9ca76
docs: align automated release guidance
imshashank 1da4666
fix(ci): recover prior dated release tags
imshashank c4c6d60
fix(ci): recover historical dated releases
imshashank 1e0fa1e
fix(ci): avoid overlapping recovery notes
imshashank 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 |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| name: Automated Releases | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: '0 0 * * 0' | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: automated-release | ||
| cancel-in-progress: false | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: read | ||
|
|
||
| jobs: | ||
| tag-and-release: | ||
| name: Create dated tag and release notes | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout current main | ||
| uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 | ||
| with: | ||
| ref: main | ||
| fetch-depth: 0 | ||
| persist-credentials: false | ||
|
|
||
| - name: Determine release target | ||
| id: target | ||
| run: | | ||
| set -euo pipefail | ||
| TARGET_SHA=$(git rev-parse HEAD) | ||
| echo "target_sha=$TARGET_SHA" >> "$GITHUB_OUTPUT" | ||
| echo "Release target: $TARGET_SHA" | ||
|
|
||
| - name: Configure git | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
|
|
||
| - name: Setup Bun for scripts | ||
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 | ||
| with: | ||
| bun-version: '1.3.14' | ||
|
|
||
| - name: Install JS/TS deps | ||
| run: bun install --frozen-lockfile | ||
|
|
||
| - name: Build release notes (TypeScript) | ||
| id: build_notes | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
greptile-apps[bot] marked this conversation as resolved.
|
||
| RELEASE_TARGET_SHA: ${{ steps.target.outputs.target_sha }} | ||
| run: | | ||
| set -euo pipefail | ||
| bun ./scripts/release-notes.ts | ||
| test -s RELEASE_NOTES.md | ||
|
|
||
| - name: Select or recover dated tag | ||
| id: release_tag | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| TAG: ${{ steps.build_notes.outputs.tag }} | ||
| TAG_ACTION: ${{ steps.build_notes.outputs.tag_action }} | ||
| RELEASE_TARGET_SHA: ${{ steps.build_notes.outputs.release_target_sha }} | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| REPOSITORY_URL="https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | ||
|
|
||
| case "$TAG_ACTION" in | ||
| reuse|recover) | ||
| EXISTING_SHA=$(git rev-list -n 1 "$TAG^{commit}") | ||
|
|
||
| if [ "$EXISTING_SHA" != "$RELEASE_TARGET_SHA" ]; then | ||
| echo "Selected tag $TAG does not point to release target $RELEASE_TARGET_SHA" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Using existing tag $TAG at $RELEASE_TARGET_SHA" | ||
| ;; | ||
|
|
||
| create) | ||
| echo "Creating annotated tag $TAG at $RELEASE_TARGET_SHA" | ||
| git tag -a "$TAG" "$RELEASE_TARGET_SHA" -m "Automated release $TAG" | ||
| git push "$REPOSITORY_URL" "refs/tags/$TAG" | ||
| ;; | ||
|
|
||
| *) | ||
| echo "Unknown tag action: $TAG_ACTION" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
|
|
||
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Publish or recover GitHub release | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| TAG: ${{ steps.release_tag.outputs.tag }} | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| if gh release view "$TAG" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then | ||
| DRAFT=$(gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json isDraft -q .isDraft) | ||
| PRERELEASE=$(gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json isPrerelease -q .isPrerelease) | ||
|
|
||
| if [ "$DRAFT" = "true" ] || [ "$PRERELEASE" = "true" ]; then | ||
| echo "Publishing existing release $TAG" | ||
| gh release edit "$TAG" \ | ||
| --repo "$GITHUB_REPOSITORY" \ | ||
| --draft=false \ | ||
| --prerelease=false \ | ||
| --notes-file RELEASE_NOTES.md | ||
| else | ||
| echo "Release $TAG already exists. Nothing to publish." | ||
| fi | ||
|
|
||
| exit 0 | ||
| fi | ||
|
|
||
| gh release create "$TAG" \ | ||
| --repo "$GITHUB_REPOSITORY" \ | ||
| --title "$TAG" \ | ||
| --notes-file RELEASE_NOTES.md | ||
|
|
||
| echo "Published release $TAG" | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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,38 @@ | ||
| import { z } from 'zod'; | ||
|
|
||
| const labelSchema = z.object({ | ||
| name: z.string(), | ||
| }); | ||
|
|
||
| export const pullRequestSchema = z.object({ | ||
| number: z.number(), | ||
| title: z.string(), | ||
| html_url: z.string().url(), | ||
| body: z.string().nullable(), | ||
| labels: z.array(labelSchema), | ||
| merged_at: z.string().nullable(), | ||
| base: z.object({ | ||
| ref: z.string(), | ||
| }), | ||
| }); | ||
|
|
||
| export const pullRequestListSchema = z.array(pullRequestSchema); | ||
|
|
||
| export const githubCommitSchema = z.object({ | ||
| sha: z.string().min(1), | ||
| }); | ||
|
|
||
| export const commitPageSchema = z.array(githubCommitSchema); | ||
|
|
||
| export const releaseSchema = z.object({ | ||
| tag_name: z.string().min(1), | ||
| draft: z.boolean(), | ||
| prerelease: z.boolean(), | ||
| published_at: z.string().nullable(), | ||
| }); | ||
|
|
||
| export const releaseListSchema = z.array(releaseSchema); | ||
|
|
||
| export type PullRequest = z.infer<typeof pullRequestSchema>; | ||
| export type GitHubCommit = z.infer<typeof githubCommitSchema>; | ||
| export type GitHubRelease = z.infer<typeof releaseSchema>; |
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
Oops, something went wrong.
Oops, something went wrong.
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.