Files
scrollsmith/.woodpecker/ci.yml
keligrubb 54c57aee48
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/cron/ci Pipeline was successful
create release before uploading to it
2025-09-01 12:14:38 -04:00

61 lines
1.5 KiB
YAML

workspace:
base: /woodpecker
path: src
when:
- event: cron
branch: main
- event: pull_request
- event: push
branch: main
steps:
- name: lint
image: node:22
when:
event:
- pull_request
- push
commands:
- npm ci
- npm run lint
- name: generate-dungeon
image: ghcr.io/puppeteer/puppeteer:latest
when:
event:
- cron
environment:
OLLAMA_API_URL:
from_secret: OLLAMA_API_URL
OLLAMA_API_KEY:
from_secret: OLLAMA_API_KEY
commands:
- npm ci
- npm start
- name: upload-to-gitea-release
image: curlimages/curl:latest
when:
event:
- cron
environment:
GITEA_TOKEN:
from_secret: GITEA_TOKEN
commands:
- pdf=$(ls *.pdf | head -n1)
- tag=$(date +%F)
# Create the release (ignore error if it already exists)
- |
curl -s -o /dev/null -w "%{http_code}" -X POST \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"tag_name\": \"$tag\", \"name\": \"$tag\", \"draft\": false, \"prerelease\": false}" \
https://git.keligrubb.com/api/v1/repos/keligrubb/scrollsmith/releases || true
# Upload the PDF as a release asset
- |
curl -X POST \
-H "Authorization: token $GITEA_TOKEN" \
-F "attachment=@$pdf" \
"https://git.keligrubb.com/api/v1/repos/keligrubb/scrollsmith/releases/$tag/assets"