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
15 changes: 10 additions & 5 deletions .github/workflows/pr-bash-examples-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
permissions:
contents: read

env:
STAMPED_VERSION: v9.9.9-ci.${{ github.event.pull_request.head.sha }}

jobs:
examples:
name: ${{ matrix.runs-on }} / ${{ matrix.example }}
Expand Down Expand Up @@ -38,15 +41,17 @@ jobs:
sync: false
commands: |
bun run build
version-injector dist/script.sh --style sh --version "$PREPARE_RELEASE_VERSION"
version-injector dist/script.ps1 --style ps1 --version "$PREPARE_RELEASE_VERSION"
version-injector dist/script.sh --style sh --version "${{ env.STAMPED_VERSION }}"
version-injector dist/script.ps1 --style ps1 --version "${{ env.STAMPED_VERSION }}"

- name: Put prepared script on PATH
shell: bash
run: echo "$PWD/dist" >> "$GITHUB_PATH"

- name: Run Leia-backed example
- name: Verify example ${{ matrix.example }} with Leia
shell: bash
env:
TMPDIR: ${{ github.workspace }}/examples/${{ matrix.example }}/.tmp
run: |
mkdir -p examples/.tmp
TMPDIR="$PWD/examples/.tmp" ./node_modules/.bin/leia "examples/${{ matrix.example }}/README.md" -c "Destroy tests" --stdin
mkdir -p "$TMPDIR"
bun run leia "examples/${{ matrix.example }}/README.md" -c "Destroy tests" --stdin
2 changes: 1 addition & 1 deletion .github/workflows/pr-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permissions:
contents: read

jobs:
lint:
bash-lint:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/pr-powershell-examples-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
permissions:
contents: read

env:
STAMPED_VERSION: v9.9.9-ci.${{ github.event.pull_request.head.sha }}

jobs:
examples:
name: windows-2025 / ${{ matrix.example }}
Expand Down Expand Up @@ -35,15 +38,19 @@ jobs:
sync: false
commands: |
bun run build
version-injector dist/script.sh --style sh --version "$PREPARE_RELEASE_VERSION"
version-injector dist/script.ps1 --style ps1 --version "$PREPARE_RELEASE_VERSION"
version-injector dist/script.sh --style sh --version "${{ env.STAMPED_VERSION }}"
version-injector dist/script.ps1 --style ps1 --version "${{ env.STAMPED_VERSION }}"

- name: Put prepared scripts on PATH
shell: pwsh
run: '"{0}\dist" -f $PWD | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append'

- name: Run Leia-backed example
- name: Verify example ${{ matrix.example }} with Leia
shell: pwsh
env:
TMPDIR: ${{ github.workspace }}\examples\${{ matrix.example }}\.tmp
TMP: ${{ github.workspace }}\examples\${{ matrix.example }}\.tmp
TEMP: ${{ github.workspace }}\examples\${{ matrix.example }}\.tmp
run: |
New-Item -ItemType Directory -Force -Path 'examples/.tmp' | Out-Null
& "$PWD\node_modules\.bin\leia.cmd" "examples/${{ matrix.example }}/README.md" --shell pwsh -c "Destroy tests" --stdin
New-Item -ItemType Directory -Force -Path $env:TMPDIR | Out-Null
bun run leia "examples/${{ matrix.example }}/README.md" --shell pwsh -c "Destroy tests" --stdin
22 changes: 13 additions & 9 deletions .github/workflows/release-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
permissions:
contents: read

env:
STAMPED_VERSION: v9.9.9-ci.${{ github.event.pull_request.head.sha }}

jobs:
release-bash:
runs-on: ubuntu-24.04
Expand All @@ -24,20 +27,22 @@ jobs:
run: bun install --frozen-lockfile --ignore-scripts

- name: Prepare release-shaped build
id: prepare-release
uses: tanaabased/prepare-release-action@v1
with:
version: dev
sync: false
commands: |
bun run lint
bun run build
version-injector dist/script.sh --style sh --version "$PREPARE_RELEASE_VERSION"
version-injector dist/script.ps1 --style ps1 --version "$PREPARE_RELEASE_VERSION"
version-injector dist/script.sh --style sh --version "${{ env.STAMPED_VERSION }}"
version-injector dist/script.ps1 --style ps1 --version "${{ env.STAMPED_VERSION }}"

- name: Verify stamped release entrypoint
shell: bash
run: test "$(./dist/script.sh --version)" = "${{ steps.prepare-release.outputs.resolved-version }}"
run: |
actual="$(bash ./dist/script.sh --version)"
printf 'actual=%s\n' "$actual"
test "$actual" = "${{ env.STAMPED_VERSION }}"

release-powershell:
runs-on: windows-2025
Expand All @@ -56,20 +61,19 @@ jobs:
run: bun install --frozen-lockfile --ignore-scripts

- name: Prepare release-shaped build
id: prepare-release
uses: tanaabased/prepare-release-action@v1
with:
version: dev
sync: false
commands: |
bun run build
version-injector dist/script.sh --style sh --version "$PREPARE_RELEASE_VERSION"
version-injector dist/script.ps1 --style ps1 --version "$PREPARE_RELEASE_VERSION"
version-injector dist/script.sh --style sh --version "${{ env.STAMPED_VERSION }}"
version-injector dist/script.ps1 --style ps1 --version "${{ env.STAMPED_VERSION }}"

- name: Verify stamped PowerShell release entrypoint
shell: pwsh
run: |
$version = & ./dist/script.ps1 -Version
if ($version -ne "${{ steps.prepare-release.outputs.resolved-version }}") {
throw "expected version ${{ steps.prepare-release.outputs.resolved-version }}, got $version"
if ($version -ne "${{ env.STAMPED_VERSION }}") {
throw "expected version ${{ env.STAMPED_VERSION }}, got $version"
}
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

- Added [TEMPLATE-SETUP.md](./TEMPLATE-SETUP.md) as the agent-driven template adoption and seeding spec, including a copy-paste prompt plus cleanup and changelog-reset rules.
- Added Bash and PowerShell starter entrypoints at repo root for hosted script repositories on macOS, Linux, and Windows.
- Added CI linting for the maintained shell surfaces with `shellcheck` for Bash and `PSScriptAnalyzer` for PowerShell.
- Added Netlify-ready `dist/` publishing for both `script.sh` and `script.ps1`, plus landing-page, robots, and sitemap metadata.
- Added Netlify-ready tracked `dist/` publishing for both `script.sh` and `script.ps1`, plus landing-page, robots, and sitemap metadata.
- Added release workflows that stamp both distributed entrypoints with `prepare-release-action` and verify the shipped artifacts before release.
- Added runtime-specific Leia example suites for Bash and PowerShell, with Bash coverage on Ubuntu and macOS plus PowerShell coverage on Windows.
- Documented the starter's hosted install, local usage, and template-adoption flow for both runtime paths.
- Documented the starter's hosted install, local usage, and agent-driven post-fork setup flow for both runtime paths.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,32 @@ Bash and PowerShell scripts. The primary entrypoints live at repo root, support
Netlify serves.

> Supports Bash on macOS and Linux plus PowerShell on Windows.
>
> If you are adopting this repository as a template, start with
> [`TEMPLATE-SETUP.md`](./TEMPLATE-SETUP.md). It is the agent-driven setup spec and manual
> post-fork checklist.

## Quickstart

```sh
curl -fsSL https://script.example.com/script.sh | bash
curl -fsSL https://script.tanaab.sh/script.sh | bash
```

```powershell
irm https://script.example.com/script.ps1 | iex
irm https://script.tanaab.sh/script.ps1 | iex
```

## Installation

`template-netscript` is designed around hosted raw scripts at `https://script.example.com/script.sh`
and `https://script.example.com/script.ps1`.
`template-netscript` is designed around hosted raw scripts at `https://script.tanaab.sh/script.sh`
and `https://script.tanaab.sh/script.ps1`.

- The Bash path requires Bash and cURL.
- The PowerShell path requires PowerShell.
- The hosted URLs serve the generated `dist/script.sh` and `dist/script.ps1` entrypoints used for
release-shaped validation and Netlify publishing.
- In a repository created from this template, replace `script.sh`, `script.ps1`, and
`https://script.example.com` before publishing.
`https://script.tanaab.sh` before publishing.

## Usage

Expand Down Expand Up @@ -64,7 +68,7 @@ a directory that is already in your `PATH` or one you manage yourself.

```sh
mkdir -p "$HOME/.local/bin"
curl -fsSL https://script.example.com/script.sh -o "$HOME/.local/bin/script"
curl -fsSL https://script.tanaab.sh/script.sh -o "$HOME/.local/bin/script"
chmod +x "$HOME/.local/bin/script"

script --help
Expand All @@ -74,7 +78,7 @@ script --version
```powershell
$target = Join-Path $HOME 'bin\script.ps1'
New-Item -ItemType Directory -Force -Path (Split-Path -Parent $target) | Out-Null
Invoke-WebRequest https://script.example.com/script.ps1 -OutFile $target
Invoke-WebRequest https://script.tanaab.sh/script.ps1 -OutFile $target

& $target -Help
& $target -Version
Expand All @@ -86,7 +90,7 @@ If you are using this repository as a GitHub template, the adoption flow is:
2. Rename `script.sh` and `script.ps1`, then update the same paths in `README.md`, `scripts/build-dist.js`,
`site/index.html`, `netlify.toml`, `examples/`, and `.github/workflows/`.
3. Replace the placeholder command bodies in `script.sh` and `script.ps1`.
4. Replace the placeholder origin `https://script.example.com`.
4. Replace the placeholder origin `https://script.tanaab.sh`.
5. Run the local checks before pushing.

## Development
Expand Down
Loading
Loading