feat(regime)
This commit is contained in:
commit
2be7ec6836
62 changed files with 1817 additions and 0 deletions
29
actions/checks/action.yml
Normal file
29
actions/checks/action.yml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
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: Resolve external workspaces
|
||||
shell: bash
|
||||
run: bun "$GITHUB_ACTION_PATH/../../scripts/resolve-workspaces.ts"
|
||||
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: bun install --no-save-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
55
actions/mirror/action.yml
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
name: Mirror to GitHub
|
||||
description: Mirror the current repo to GitHub.
|
||||
|
||||
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"
|
||||
48
actions/publish-npm/action.yml
Normal file
48
actions/publish-npm/action.yml
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
name: Publish to NPM
|
||||
description: Run semantic-release (multi for monorepos, standard for solo packages)
|
||||
|
||||
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: Resolve external workspaces
|
||||
shell: bash
|
||||
run: bun "$GITHUB_ACTION_PATH/../../scripts/resolve-workspaces.ts"
|
||||
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: bun install --no-save-lockfile
|
||||
|
||||
- name: Configure npm auth
|
||||
shell: bash
|
||||
env:
|
||||
NPM_TOKEN: ${{ inputs.npm-token }}
|
||||
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.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: |
|
||||
# TODO: use bun
|
||||
if node -e "const p=require('./package.json'); process.exit(p.workspaces ? 0 : 1)"; then
|
||||
bunx multi-semantic-release
|
||||
else
|
||||
bunx semantic-release
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue