ci: migrate PDF release pipeline from Woodpecker to Gitea Actions (host/fish)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
|||||||
|
name: Release PDFs
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pdfs:
|
||||||
|
# Host executor (runs on kasse as gitea-runner) using fish; pandoc/typst/jq are on the host.
|
||||||
|
# Replaces the retired Woodpecker `local` backend.
|
||||||
|
runs-on: fish
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: fish {0}
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: https://gitea.com/actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Render markdown to PDF and attach to the release
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
mkdir -p dist
|
||||||
|
curl -sLo icon.svg https://klingenbergbygg.no/icon-normalized.svg
|
||||||
|
for md in (find . -name "*.md" ! -path "./.git/*")
|
||||||
|
pandoc -f gfm+tex_math_dollars -t pdf -o "dist/$(basename $md .md).pdf" --pdf-engine=typst --template=stil.typ $md
|
||||||
|
end
|
||||||
|
set REL_ID (curl --silent --fail --header "Authorization: token $TOKEN" "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/releases/tags/$GITHUB_REF_NAME" | jq -r '.id')
|
||||||
|
for pdf in (find dist -name '*.pdf')
|
||||||
|
curl --silent --show-error --fail --header "Authorization: token $TOKEN" --form "attachment=@$pdf" "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/releases/$REL_ID/assets?name=$(basename $pdf)"
|
||||||
|
end
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
steps:
|
|
||||||
- name: convert-markdown-to-pdf
|
|
||||||
image: fish
|
|
||||||
commands:
|
|
||||||
- mkdir -p dist
|
|
||||||
- curl -sLo icon.svg https://klingenbergbygg.no/icon-normalized.svg
|
|
||||||
- for md in (find . -name "*.md" ! -path "./.git/*"); pandoc -f gfm+tex_math_dollars -t pdf -o "dist/$(basename $md .md).pdf" --pdf-engine=typst --template=stil.typ $md; end
|
|
||||||
- "curl --silent --fail --header \"Authorization: token $GITEA_PACKAGE_TOKEN\" \"$GITEA_SERVER/api/v1/repos/$CI_REPO/releases/tags/$CI_COMMIT_TAG\" | jq -r '.id' > ./release_id"
|
|
||||||
- "for pdf in (find dist -name '*.pdf'); curl --silent --show-error --fail --header \"Authorization: token $GITEA_PACKAGE_TOKEN\" --form \"attachment=@$pdf\" \"$GITEA_SERVER/api/v1/repos/$CI_REPO/releases/\"(cat ./release_id)\"/assets?name=\"(basename $pdf); end"
|
|
||||||
when:
|
|
||||||
- event: [tag]
|
|
||||||
branch: main
|
|
||||||
Reference in New Issue
Block a user