Compare commits
1 Commits
main
...
136e83c646
| Author | SHA1 | Date | |
|---|---|---|---|
| 136e83c646 |
@@ -1,43 +0,0 @@
|
|||||||
name: PR
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
name: lint
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: https://github.com/actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Setup Node
|
|
||||||
uses: https://github.com/actions/setup-node@v6
|
|
||||||
with:
|
|
||||||
node-version: "24"
|
|
||||||
cache: "npm"
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Lint
|
|
||||||
run: npm run lint
|
|
||||||
|
|
||||||
test-coverage:
|
|
||||||
name: test-coverage
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: https://github.com/actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Setup Node
|
|
||||||
uses: https://github.com/actions/setup-node@v6
|
|
||||||
with:
|
|
||||||
node-version: "24"
|
|
||||||
cache: "npm"
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Test with coverage
|
|
||||||
run: npm run test:coverage
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
name: Release
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
schedule:
|
|
||||||
- cron: "0 0 * * *"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
generate-dungeon:
|
|
||||||
name: generate-dungeon
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: ghcr.io/puppeteer/puppeteer:latest
|
|
||||||
env:
|
|
||||||
OLLAMA_API_URL: https://ai.keligrubb.com/api/chat/completions
|
|
||||||
OLLAMA_API_KEY: ${{ secrets.OLLAMA_API_KEY }}
|
|
||||||
COMFYUI_URL: http://192.168.1.124:8188
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: https://github.com/actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Setup Node
|
|
||||||
uses: https://github.com/actions/setup-node@v6
|
|
||||||
with:
|
|
||||||
node-version: "24"
|
|
||||||
cache: "npm"
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Generate dungeon PDF
|
|
||||||
run: npm start
|
|
||||||
|
|
||||||
- name: Upload PDF artifact
|
|
||||||
uses: https://github.com/actions/upload-artifact@v7
|
|
||||||
with:
|
|
||||||
name: release-pdf
|
|
||||||
path: "*.pdf"
|
|
||||||
|
|
||||||
upload-to-gitea-release:
|
|
||||||
name: upload-to-gitea-release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: generate-dungeon
|
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.SCROLLSMITH_GITEA_TOKEN }}
|
|
||||||
steps:
|
|
||||||
- name: Download PDF artifact
|
|
||||||
uses: https://github.com/actions/download-artifact@v8
|
|
||||||
with:
|
|
||||||
name: release-pdf
|
|
||||||
|
|
||||||
- name: Create release and upload PDF
|
|
||||||
run: |
|
|
||||||
api_base="https://git.keligrubb.com/api/v1/repos/${{ gitea.repository }}"
|
|
||||||
pdf=$(ls *.pdf | head -n1)
|
|
||||||
tag=$(date +%F)
|
|
||||||
echo "Creating release for tag $tag..."
|
|
||||||
create_resp=$(curl -s -w "%{http_code}" -o /tmp/create.json -X POST \
|
|
||||||
-H "Authorization: token $GITEA_TOKEN" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d "{\"tag_name\":\"$tag\",\"name\":\"$tag\"}" \
|
|
||||||
"$api_base/releases")
|
|
||||||
echo "Create release HTTP status: $create_resp"
|
|
||||||
echo "Fetching release ID..."
|
|
||||||
release_id=$(curl -s \
|
|
||||||
-H "Authorization: token $GITEA_TOKEN" \
|
|
||||||
"$api_base/releases/tags/$tag" |
|
|
||||||
awk -F: '/"id"[ ]*:/ {gsub(/[^0-9]/,"",$2); print $2; exit}')
|
|
||||||
echo "Release ID = $release_id"
|
|
||||||
echo "Checking if asset $pdf already exists..."
|
|
||||||
assets=$(curl -s -H "Authorization: token $GITEA_TOKEN" \
|
|
||||||
"$api_base/releases/$release_id/assets")
|
|
||||||
echo "Assets response: $assets"
|
|
||||||
if echo "$assets" | grep -q "\"name\":\"$pdf\""; then
|
|
||||||
echo "Asset $pdf already uploaded, skipping."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
echo "Uploading $pdf to release $release_id..."
|
|
||||||
upload_resp=$(curl -s -w "%{http_code}" -o /tmp/upload.json -X POST \
|
|
||||||
-H "Authorization: token $GITEA_TOKEN" \
|
|
||||||
-F "attachment=@$pdf" \
|
|
||||||
"$api_base/releases/$release_id/assets")
|
|
||||||
echo "Upload HTTP status: $upload_resp"
|
|
||||||
echo "Upload response: $(cat /tmp/upload.json)"
|
|
||||||
19
.woodpecker/pr.yml
Normal file
19
.woodpecker/pr.yml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
workspace:
|
||||||
|
base: /woodpecker
|
||||||
|
path: pr
|
||||||
|
|
||||||
|
when:
|
||||||
|
- event: pull_request
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: lint
|
||||||
|
image: node:24-slim@sha256:a81a03dd965b4052269a57fac857004022b522a4bf06e7a739e25e18bce45af2
|
||||||
|
commands:
|
||||||
|
- npm ci
|
||||||
|
- npm run lint
|
||||||
|
|
||||||
|
- name: test-coverage
|
||||||
|
image: node:24-slim@sha256:a81a03dd965b4052269a57fac857004022b522a4bf06e7a739e25e18bce45af2
|
||||||
|
commands:
|
||||||
|
- npm ci
|
||||||
|
- npm run test:coverage
|
||||||
61
.woodpecker/release.yml
Normal file
61
.woodpecker/release.yml
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
workspace:
|
||||||
|
base: /woodpecker
|
||||||
|
path: release
|
||||||
|
|
||||||
|
when:
|
||||||
|
- event: cron
|
||||||
|
branch: main
|
||||||
|
- event: push
|
||||||
|
branch: main
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: generate-dungeon
|
||||||
|
image: ghcr.io/puppeteer/puppeteer:latest@sha256:19d010877be7911acd7ad1795f603b4ca604c88c26848b81d1d9914e85a289e4
|
||||||
|
environment:
|
||||||
|
OLLAMA_API_URL:
|
||||||
|
from_secret: OLLAMA_API_URL
|
||||||
|
OLLAMA_API_KEY:
|
||||||
|
from_secret: OLLAMA_API_KEY
|
||||||
|
COMFYUI_URL:
|
||||||
|
from_secret: COMFYUI_URL
|
||||||
|
commands:
|
||||||
|
- npm ci
|
||||||
|
- npm start
|
||||||
|
|
||||||
|
- name: upload-to-gitea-release
|
||||||
|
image: curlimages/curl:latest@sha256:d94d07ba9e7d6de898b6d96c1a072f6f8266c687af78a74f380087a0addf5d17
|
||||||
|
environment:
|
||||||
|
GITEA_TOKEN:
|
||||||
|
from_secret: GITEA_TOKEN
|
||||||
|
commands:
|
||||||
|
- pdf=$(ls *.pdf | head -n1)
|
||||||
|
- tag=$(date +%F)
|
||||||
|
- |
|
||||||
|
echo "Creating release for tag $tag..."
|
||||||
|
create_resp=$(curl -s -w "%{http_code}" -o /tmp/create.json -X POST \
|
||||||
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{\"tag_name\":\"$tag\",\"name\":\"$tag\"}" \
|
||||||
|
https://git.keligrubb.com/api/v1/repos/keligrubb/scrollsmith/releases)
|
||||||
|
echo "Create release HTTP status: $create_resp"
|
||||||
|
echo "Fetching release ID..."
|
||||||
|
release_id=$(curl -s \
|
||||||
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
|
https://git.keligrubb.com/api/v1/repos/keligrubb/scrollsmith/releases/tags/$tag |
|
||||||
|
awk -F: '/"id"[ ]*:/ {gsub(/[^0-9]/,"",$2); print $2; exit}')
|
||||||
|
echo "Release ID = $release_id"
|
||||||
|
echo "Checking if asset $pdf already exists..."
|
||||||
|
assets=$(curl -s -H "Authorization: token $GITEA_TOKEN" \
|
||||||
|
https://git.keligrubb.com/api/v1/repos/keligrubb/scrollsmith/releases/$release_id/assets)
|
||||||
|
echo "Assets response: $assets"
|
||||||
|
if echo "$assets" | grep -q "\"name\":\"$pdf\""; then
|
||||||
|
echo "Asset $pdf already uploaded, skipping."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "Uploading $pdf to release $release_id..."
|
||||||
|
upload_resp=$(curl -s -w "%{http_code}" -o /tmp/upload.json -X POST \
|
||||||
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
|
-F "attachment=@$pdf" \
|
||||||
|
https://git.keligrubb.com/api/v1/repos/keligrubb/scrollsmith/releases/$release_id/assets)
|
||||||
|
echo "Upload HTTP status: $upload_resp"
|
||||||
|
echo "Upload response: $(cat /tmp/upload.json)"
|
||||||
10
package.json
10
package.json
@@ -20,10 +20,10 @@
|
|||||||
"sharp": "^0.34.3"
|
"sharp": "^0.34.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^10.0.0",
|
"@eslint/js": "10.0.1",
|
||||||
"@vitest/coverage-v8": "^4.0.18",
|
"@vitest/coverage-v8": "4.0.18",
|
||||||
"eslint": "^10.0.0",
|
"eslint": "10.0.1",
|
||||||
"globals": "^17.0.0",
|
"globals": "17.3.0",
|
||||||
"vitest": "^4.0.18"
|
"vitest": "4.0.18"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user