chore(examples): link templates and sync their pinned version on release - #327
Merged
Conversation
The storm-example-* repos are GitHub templates (#213). Add "Use this template" links to the README examples table and the getting-started guide, and add a release job that rewrites the st.orm plugin version pinned in each template so a project generated from it starts on the release. Also correct the Ktor example stack (Ktor DI, not Koin).
There was a problem hiding this comment.
Pull request overview
This PR completes the “template” portion of issue #213 by linking the example repos as GitHub templates in the README/docs and adding a release workflow job to keep those template repos pinned to the newly released Storm Gradle plugin version.
Changes:
- Add “Use this template” (
/generate) links for the three starter templates inREADME.mdanddocs/getting-started.md. - Update the README example stack description for the Ktor example (Ktor DI instead of Koin).
- Add a
sync-example-templatesjob to.github/workflows/release.ymlto bump the pinnedid("st.orm") versionin the five example/template repositories on release.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| README.md | Updates example stack info and adds “Use this template” links for starter repos. |
| docs/getting-started.md | Adds a prominent “Fastest start” callout linking to template generation. |
| .github/workflows/release.yml | Adds a release job to sync the pinned st.orm plugin version across template repos. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| storm-example-kotlin-ktor \ | ||
| storm-example-kotlin-ktor-graalvm; do | ||
| git clone --depth 1 "https://x-access-token:${GH_TOKEN}@github.com/storm-orm/${repo}.git" "$repo" | ||
| sed -i -E "s/(id\(\"st\.orm\"\) version \")[0-9]+\.[0-9]+\.[0-9]+/\1${V}/g" "$repo/build.gradle.kts" |
Address PR review: replace the whole quoted st.orm version (so any
-SNAPSHOT/-rc suffix is dropped, not just the x.y.z digits), and add
permissions: {} to the sync-example-templates job since it pushes via
RELEASE_TOKEN and never uses the default GITHUB_TOKEN.
| env: | ||
| GH_TOKEN: ${{ secrets.RELEASE_TOKEN }} | ||
| run: | | ||
| V="${{ steps.version.outputs.VERSION }}" |
| git clone --depth 1 "https://x-access-token:${GH_TOKEN}@github.com/storm-orm/${repo}.git" "$repo" | ||
| # Replace the whole quoted version so any -SNAPSHOT/-rc suffix is dropped | ||
| # and the template pins the exact release. | ||
| sed -i -E "s/(id\(\"st\.orm\"\) version \")[^\"]*(\")/\1${V}\2/g" "$repo/build.gradle.kts" |
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.
Finishes the template half of #213. The
storm newCLI scaffolder is split out into #326.Changes
/generate) to the three starter templates, in the examples table and the getting-started guide. Also fixes a stale stack fact for the Ktor example (Ktor DI, not Koin).sync-example-templatesjob that rewrites only theid("st.orm") versionline pinned in each of the five example repos on release, so "Use this template" always starts on the current version. Kotlin / KSP / Ktor toolchain versions are left untouched.Notes
RELEASE_TOKENto have write access to thestorm-orm/storm-example-*repos; today it only pushes the framework docs snapshot. Confirm the token scope (or swap in a token/App that can push to those repos) before relying on it.getting-started.mdchange surfaces at/docs/next; live/docs/*picks it up at the next release snapshot.Fixes #213