feat(regime)

This commit is contained in:
Dan Finch 2026-04-29 00:55:53 +02:00
commit 655175f273
36 changed files with 1066 additions and 0 deletions

25
actions/checks/action.yml Normal file
View file

@ -0,0 +1,25 @@
name: Checks
description: Run lint, type-check, and tests
runs:
using: composite
steps:
- name: Setup Bun
shell: bash
run: curl -fsSL https://bun.sh/install | bash && echo "$HOME/.bun/bin" >> "$GITHUB_PATH"
- name: Install dependencies
shell: bash
run: bun install --frozen-lockfile
- name: Lint
shell: bash
run: bun run lint
- name: Type check
shell: bash
run: bun run check
- name: Test
shell: bash
run: bun run test

55
actions/mirror/action.yml Normal file
View file

@ -0,0 +1,55 @@
name: Mirror to GitHub
description: Mirror the current repo to GitHub, optionally filtering paths listed in .mirrorignore
inputs:
target:
description: "GitHub repo (e.g. owner/repo)"
required: true
source:
description: "Authenticated clone URL for the source repo"
required: true
token:
description: "GitHub personal access token with push access"
required: true
runs:
using: composite
steps:
- name: Install git-filter-repo
shell: bash
run: pip install --break-system-packages git-filter-repo
- name: Clone mirror
shell: bash
run: git clone --bare "$GITHUB_WORKSPACE" /tmp/mirror-repo
- name: Filter ignored paths
shell: bash
run: |
MIRRORIGNORE="$GITHUB_WORKSPACE/.mirrorignore"
if [ ! -f "$MIRRORIGNORE" ]; then
echo "No .mirrorignore found, skipping filter"
exit 0
fi
ARGS=""
while IFS= read -r line || [ -n "$line" ]; do
line="$(echo "$line" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')"
[ -z "$line" ] && continue
[[ "$line" == \#* ]] && continue
ARGS="$ARGS --path $line"
done < "$MIRRORIGNORE"
# Always filter .mirrorignore itself
ARGS="$ARGS --path .mirrorignore"
if [ -n "$ARGS" ]; then
cd /tmp/mirror-repo
git filter-repo $ARGS --invert-paths --force
fi
- name: Push mirror
shell: bash
run: |
cd /tmp/mirror-repo
git push --mirror "https://${{ inputs.token }}@github.com/${{ inputs.target }}.git"

View file

@ -0,0 +1,38 @@
name: Semantic Release
description: Run multi-semantic-release for per-package versioning
inputs:
gitea-token:
description: "Forgejo API token with push + API access"
required: true
gitea-url:
description: "Forgejo instance URL"
required: true
npm-token:
description: "npm registry auth token"
required: true
runs:
using: composite
steps:
- name: Setup Bun
shell: bash
run: curl -fsSL https://bun.sh/install | bash && echo "$HOME/.bun/bin" >> "$GITHUB_PATH"
- name: Install dependencies
shell: bash
run: bun install --frozen-lockfile
- name: Configure npm auth
shell: bash
env:
NPM_TOKEN: ${{ inputs.npm-token }}
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > "$GITHUB_WORKSPACE/.npmrc"
- name: Run multi-semantic-release
shell: bash
env:
GITEA_TOKEN: ${{ inputs.gitea-token }}
GITEA_URL: ${{ inputs.gitea-url }}
NPM_TOKEN: ${{ inputs.npm-token }}
run: bunx multi-semantic-release