Compare commits
2 commits
pre-rewrit
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a5f867eeea | ||
|
|
ffac6fe22a |
3 changed files with 79 additions and 52 deletions
|
|
@ -12,33 +12,33 @@ permissions:
|
||||||
jobs:
|
jobs:
|
||||||
lint-commits:
|
lint-commits:
|
||||||
name: Lint commits
|
name: Lint commits
|
||||||
runs-on: ubuntu-latest
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: docker.io/library/node:22
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: "22"
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Validate conventional commits
|
- name: Validate conventional commits
|
||||||
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
|
run: |
|
||||||
|
npx commitlint \
|
||||||
|
--from ${{ github.event.pull_request.base.sha }} \
|
||||||
|
--to ${{ github.event.pull_request.head.sha }} \
|
||||||
|
--verbose
|
||||||
|
|
||||||
build-and-test:
|
build-and-test:
|
||||||
name: Build & test
|
name: Build & test
|
||||||
runs-on: ubuntu-latest
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: docker.io/library/node:22
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: "22"
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
68
.forgejo/workflows/release.yml
Normal file
68
.forgejo/workflows/release.yml
Normal file
|
|
@ -0,0 +1,68 @@
|
||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: docker.io/library/node:22
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: npm test
|
||||||
|
|
||||||
|
- name: Publish to npm
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
run: |
|
||||||
|
# Set authToken explicitly — actions/setup-node was the only consumer
|
||||||
|
# of registry-url + NODE_AUTH_TOKEN, and we dropped it for Forgejo
|
||||||
|
# compat. The literal npmjs registry stays the same.
|
||||||
|
cat > ~/.npmrc <<EOF
|
||||||
|
registry=https://registry.npmjs.org/
|
||||||
|
//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}
|
||||||
|
EOF
|
||||||
|
npm publish
|
||||||
|
rm -f ~/.npmrc
|
||||||
|
|
||||||
|
- name: Create Forgejo release with auto-generated notes
|
||||||
|
env:
|
||||||
|
FORGEJO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
FORGEJO_API: http://forgejo:3000/api/v1
|
||||||
|
REPO: torrentclaw/torrentclaw-mcp
|
||||||
|
TAG: ${{ github.ref_name }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
apt-get update && apt-get install -y --no-install-recommends jq curl
|
||||||
|
|
||||||
|
# Compose release body from commits since the previous tag.
|
||||||
|
prev=$(git describe --tags --abbrev=0 "${TAG}^" 2>/dev/null || echo "")
|
||||||
|
if [ -n "$prev" ]; then
|
||||||
|
notes=$(git log --pretty=format:'- %s' "${prev}..${TAG}")
|
||||||
|
else
|
||||||
|
notes=$(git log --pretty=format:'- %s' "${TAG}")
|
||||||
|
fi
|
||||||
|
body=$(jq -n --arg t "$TAG" --arg n "$notes" \
|
||||||
|
'{tag_name:$t, name:$t, body:$n, draft:false, prerelease:false}')
|
||||||
|
curl -sSf -X POST "$FORGEJO_API/repos/$REPO/releases" \
|
||||||
|
-H "Authorization: token $FORGEJO_TOKEN" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "$body" >/dev/null || \
|
||||||
|
echo "Release may already exist for $TAG"
|
||||||
41
.github/workflows/release.yml
vendored
41
.github/workflows/release.yml
vendored
|
|
@ -1,41 +0,0 @@
|
||||||
name: Release
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "v*"
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
release:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: "22"
|
|
||||||
registry-url: "https://registry.npmjs.org"
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: npm run build
|
|
||||||
|
|
||||||
- name: Test
|
|
||||||
run: npm test
|
|
||||||
|
|
||||||
- name: Publish to npm
|
|
||||||
run: npm publish
|
|
||||||
env:
|
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
||||||
|
|
||||||
- name: GitHub Release
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
with:
|
|
||||||
generate_release_notes: true
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue