Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
contents: write
actions: read
steps:
# Add CI secret/auth steps here (e.g. configure AWS, custom tokens).
## <<Stencil::Block(getMoreCiSecrets)>>

## <</Stencil::Block>>
Expand All @@ -51,17 +52,20 @@ jobs:
with:
github-token: ${{ github.token }}
version: "latest"
# Add auth steps for build/test here (e.g. login to private registry).
## <<Stencil::Block(buildtestauth)>>
## <</Stencil::Block>>
- name: Build Test repo
run: mise run buildtest
# Fill in env: -> GITHUB_TOKEN here if you need a custom token to read module dependencies
# Add env vars for the Build Test repo step here.
## <<Stencil::Block(buildTestEnvVars)>>

## <</Stencil::Block>>
- name: Run Tests
run: mise run runtest
# Fill in env: -> GITHUB_TOKEN here if you need a custom token to read module dependencies
# Add env vars for the Run Tests step here.
## <<Stencil::Block(runTestEnvVars)>>

## <</Stencil::Block>>
Expand All @@ -71,13 +75,15 @@ jobs:
run: mise run gentable
env:
# Fill in GH_TOKEN env with a different token here if you need a custom token to read module dependencies
# Override token for README updates here. Default: GH_TOKEN from github.token.
## <<Stencil::Block(readmeUpdateGhToken)>>
GH_TOKEN: ${{ github.token }}
## <</Stencil::Block>>
- name: Commit back any changes
uses: stefanzweifel/git-auto-commit-action@e348103e9026cc0eee72ae06630dbe30c8bf7a79 #v5
with:
commit_message: Update README.md manifest options table
# Add extra build/test steps here (run after standard build and test).
## <<Stencil::Block(buildteststeps)>>

## <</Stencil::Block>>
Expand Down Expand Up @@ -116,6 +122,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release

# Add additional workflow jobs here (alongside build-and-test and build-release).
## <<Stencil::Block(extraActions)>>

## <</Stencil::Block>>
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ tests/native/*
!tests/template
tests/template/*
!tests/template/stencil.yaml
# Add additional gitignore patterns here (e.g. "*.log", "custom-dir/").
## <<Stencil::Block(ignores)>>

## <</Stencil::Block>>
3 changes: 3 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[tools]
nodejs = "lts"
pnpm = "latest"
# Add additional tool versions here (e.g. rust = "1.75"). Installed via mise alongside defaults.
## <<Stencil::Block(additionalTools)>>

## <</Stencil::Block>>
Expand Down Expand Up @@ -29,6 +30,7 @@ done
[tasks.runtest]
description = 'Run the tests'
dir = "tests"
# Customize test runner: override run command and/or add env vars for the runtest task.
## <<Stencil::Block(runTests)>>
run = """
#!/usr/bin/env bash
Expand All @@ -43,6 +45,7 @@ mise run test
description = 'Generate the README.md table of arguments'
run = "node scripts/yamltotable.js"

# Add custom mise tasks here (e.g. [tasks.mytask] description = "...", run = "...").
## <<Stencil::Block(tasks)>>

## <</Stencil::Block>>
3 changes: 3 additions & 0 deletions manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: github.com/udemy/stencil-module-base
type: templates
arguments:
# Add custom Stencil module arguments here. Used in templates when generating projects.
## <<Stencil::Block(arguments)>>
nativeModule:
required: false
Expand Down Expand Up @@ -35,9 +36,11 @@ arguments:
description: package.json scripts to add to the generated package.json (key/value map)
## <</Stencil::Block>>
modules:
# Add additional Stencil modules to include. Loaded and available during project generation.
## <<Stencil::Block(modules)>>

## <</Stencil::Block>>
# Add extra manifest config here (e.g. postRunCommand, hooks).
## <<Stencil::Block(extra)>>
postRunCommand:
- name: Install/Update pnpm deps to lockfile
Expand Down
9 changes: 9 additions & 0 deletions templates/.github/workflows/build-release.yml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
contents: write
actions: read
steps:
# Add CI secret/auth steps here (e.g. configure AWS, custom tokens).
## <<Stencil::Block(getMoreCiSecrets)>>
{{ file.Block "getMoreCiSecrets" }}
## <</Stencil::Block>>
Expand Down Expand Up @@ -79,6 +80,7 @@ jobs:
run: mise run build
- name: Run Go Tests
run: go run gotest.tools/gotestsum@latest
# Add env vars for Go tests here (e.g. TEST_DB_URL).
## <<Stencil::Block(gotestvars)>>
{{ file.Block "gotestvars" }}
## <</Stencil::Block>>
Expand All @@ -89,18 +91,21 @@ jobs:
with:
github-token: {{ "${{ github.token }}" }}
version: 'latest'
# Add auth steps for build/test here (e.g. login to private registry).
## <<Stencil::Block(buildtestauth)>>
{{ file.Block "buildtestauth" }}
## <</Stencil::Block>>
- name: Build Test repo
run: mise run buildtest
# Fill in env: -> GITHUB_TOKEN here if you need a custom token to read module dependencies
# Add env vars for the Build Test repo step here.
## <<Stencil::Block(buildTestEnvVars)>>
{{ file.Block "buildTestEnvVars" }}
## <</Stencil::Block>>
- name: Run Tests
run: mise run runtest
# Fill in env: -> GITHUB_TOKEN here if you need a custom token to read module dependencies
# Add env vars for the Run Tests step here.
## <<Stencil::Block(runTestEnvVars)>>
{{ file.Block "runTestEnvVars" }}
## <</Stencil::Block>>
Expand All @@ -110,6 +115,7 @@ jobs:
run: mise run gentable
env:
# Fill in GH_TOKEN env with a different token here if you need a custom token to read module dependencies
# Override token for README updates here. Default: GH_TOKEN from github.token.
## <<Stencil::Block(readmeUpdateGhToken)>>
{{- if empty (file.Block "readmeUpdateGhToken") }}
GH_TOKEN: {{ "${{ github.token }}" }}
Expand All @@ -121,6 +127,7 @@ jobs:
uses: stefanzweifel/git-auto-commit-action@e348103e9026cc0eee72ae06630dbe30c8bf7a79 #v5
with:
commit_message: Update README.md manifest options table
# Add extra build/test steps here (run after standard build and test).
## <<Stencil::Block(buildteststeps)>>
{{ file.Block "buildteststeps" }}
## <</Stencil::Block>>
Expand Down Expand Up @@ -192,6 +199,7 @@ jobs:
args: release --release-notes tempchangelog.md --clean
env:
GITHUB_TOKEN: {{ "${{ secrets.GITHUB_TOKEN }}" }}
# Add env vars for goreleaser here (e.g. CUSTOM_VAR from secrets).
## <<Stencil::Block(goreleaserEnvVars)>>
{{ file.Block "goreleaserEnvVars" }}
## <</Stencil::Block>>
Expand All @@ -204,6 +212,7 @@ jobs:
run: npx semantic-release
{{- end }}

# Add additional workflow jobs here (alongside build-and-test and build-release).
## <<Stencil::Block(extraActions)>>
{{ file.Block "extraActions" }}
## <</Stencil::Block>>
1 change: 1 addition & 0 deletions templates/.gitignore.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ tests/{{ $entry.Name }}/*
{{ end -}}
{{ end -}}
{{ end -}}
# Add additional gitignore patterns here (e.g. "*.log", "custom-dir/").
## <<Stencil::Block(ignores)>>
{{ file.Block "ignores" }}
## <</Stencil::Block>>
3 changes: 3 additions & 0 deletions templates/.goreleaser.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ builds:
ldflags:
- -s
- -w
# Add extra linker flags for the plugin build (e.g. -X main.version=1.0.0).
## <<Stencil::Block(pluginLdflags)>>
{{ file.Block "pluginLdflags" }}
## <</Stencil::Block>>
Expand All @@ -22,13 +23,15 @@ builds:
goarch:
- amd64
- arm64
# Add extra architectures to build (e.g. "386", "arm"). Defaults: amd64, arm64.
## <<Stencil::Block(pluginExtraArch)>>
{{ file.Block "pluginExtraArch" }}
## <</Stencil::Block>>
goos:
- linux
- darwin
- windows
# Add extra OS targets to build (e.g. "freebsd", "openbsd"). Defaults: linux, darwin, windows.
## <<Stencil::Block(pluginExtraOS)>>
{{ file.Block "pluginExtraOS" }}
## <</Stencil::Block>>
Expand Down
3 changes: 3 additions & 0 deletions templates/.mise.toml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ goreleaser = "latest"
"go:golang.org/x/tools/cmd/goimports" = "latest"
"go:github.com/thenativeweb/get-next-version" = "latest"
{{- end }}
# Add additional tool versions here (e.g. rust = "1.75"). Installed via mise alongside defaults.
## <<Stencil::Block(additionalTools)>>
{{ file.Block "additionalTools" }}
## <</Stencil::Block>>
Expand Down Expand Up @@ -75,6 +76,7 @@ done
[tasks.runtest]
description = 'Run the tests'
dir = "tests"
# Customize test runner: override run command and/or add env vars for the runtest task.
## <<Stencil::Block(runTests)>>
{{- if (empty (file.Block "runTests")) }}
env = {ENV_VAR_NAME = 'hooray'} # env vars for the script
Expand All @@ -92,6 +94,7 @@ echo "Tests are running"
description = 'Generate the README.md table of arguments'
run = "node scripts/yamltotable.js"

# Add custom mise tasks here (e.g. [tasks.mytask] description = "...", run = "...").
## <<Stencil::Block(tasks)>>
{{ file.Block "tasks" }}
## <</Stencil::Block>>
1 change: 1 addition & 0 deletions templates/go.mod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module github.com/{{ stencil.Arg "githubOrg" }}/{{ .Config.Name }}

go 1.25

// Add extra Go module dependencies here. If empty, default require block is used; if set, it replaces the default.
// <<Stencil::Block(requires)>>
{{- if empty (trim (file.Block "requires")) }}
require (
Expand Down
3 changes: 3 additions & 0 deletions templates/manifest.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ type: templates
{{- fail "Either templateModule or nativeModule must be true" }}
{{- end }}
arguments:
# Add custom Stencil module arguments here. Used in templates when generating projects.
## <<Stencil::Block(arguments)>>
{{ file.Block "arguments" }}
## <</Stencil::Block>>
modules:
# Add additional Stencil modules to include. Loaded and available during project generation.
## <<Stencil::Block(modules)>>
{{ file.Block "modules" }}
## <</Stencil::Block>>
# Add extra manifest config here (e.g. postRunCommand, hooks).
## <<Stencil::Block(extra)>>
{{ file.Block "extra" }}
## <</Stencil::Block>>
Loading