From 919a1b624c6142bb7ae1743c5ae82e437830105c Mon Sep 17 00:00:00 2001 From: bl Date: Wed, 22 Jul 2026 14:37:44 +0200 Subject: [PATCH] ci: migrate PDF release pipeline from Woodpecker to Gitea Actions (host/fish) Co-Authored-By: Claude Opus 4.8 --- .gitea/workflows/release.yml | 31 +++++++++++++++++++++++++++++++ .woodpecker.yml | 12 ------------ 2 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 .gitea/workflows/release.yml delete mode 100644 .woodpecker.yml diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..b11bae9 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -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 diff --git a/.woodpecker.yml b/.woodpecker.yml deleted file mode 100644 index 1e03f37..0000000 --- a/.woodpecker.yml +++ /dev/null @@ -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 \ No newline at end of file