Skip to content

Commit 430a17b

Browse files
committed
Attempt uploading to CTAN in CI
1 parent 8fa12a6 commit 430a17b

File tree

4 files changed

+77
-4
lines changed

4 files changed

+77
-4
lines changed

.github/workflows/main.yml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,18 @@ jobs:
4242
name: pgfmanual
4343
path: doc/generic/pgf/version-for-${{ matrix.engine }}/en/pgfmanual.pdf
4444

45-
- name: Build and sign zips
45+
- name: "ZIP: Build"
4646
if: matrix.engine == 'luatex'
47+
run: |
48+
texlua build.lua tds
49+
texlua build.lua ctan
50+
51+
- name: "ZIP: Sign"
52+
if: matrix.engine == 'luatex' && github.event_name != 'pull_request'
4753
env:
4854
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
4955
GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
5056
run: |
51-
# build zips
52-
texlua build.lua tds
53-
texlua build.lua ctan
5457
# get the keys
5558
printenv GPG_SECRET_KEY > "pgf-${GIT_TAG}.sec"
5659
printenv GPG_PUBLIC_KEY > "pgf-${GIT_TAG}.pub"
@@ -101,6 +104,17 @@ jobs:
101104
asset_name: pgfmanual-${{ env.GIT_TAG }}.pdf
102105
asset_content_type: application/pdf
103106

107+
- name: "Release: upload public key"
108+
uses: actions/upload-release-asset@v1
109+
if: matrix.engine == 'luatex' && startsWith(github.ref, 'refs/tags/')
110+
env:
111+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112+
with:
113+
upload_url: ${{ steps.create_release.outputs.upload_url }}
114+
asset_path: ./pgf-${{ env.GIT_TAG }}.pub
115+
asset_name: pgf-${{ env.GIT_TAG }}.pub
116+
asset_content_type: text/plain
117+
104118
- name: "Release: upload TDS zip"
105119
uses: actions/upload-release-asset@v1
106120
if: matrix.engine == 'luatex' && startsWith(github.ref, 'refs/tags/')
@@ -144,3 +158,13 @@ jobs:
144158
asset_path: ./pgf_${{ env.GIT_TAG }}.ctan.flatdir.zip.sig
145159
asset_name: pgf_${{ env.GIT_TAG }}.ctan.flatdir.zip.sig
146160
asset_content_type: text/plain
161+
162+
- name: "CTAN: Validate"
163+
if: matrix.engine == 'luatex'
164+
run: |
165+
bash ci/ctan_upload.sh validate
166+
167+
- name: "CTAN: Upload"
168+
if: matrix.engine == 'luatex' && startsWith(github.ref, 'refs/tags/') && github.repository == 'pgf-tikz/pgf'
169+
run: |
170+
bash ci/ctan_upload.sh upload

ci/ctan_upload.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env bash
2+
3+
die() {
4+
>&2 echo "$@"
5+
exit 1
6+
}
7+
8+
[[ -n ${GIT_TAG+x} ]] || die "The GIT_TAG variable is unset"
9+
10+
case "$1" in
11+
validate|upload) ;;
12+
*) die "Unsupported action: $1" ;;
13+
esac
14+
15+
CTAN_NOTES=$(mktemp)
16+
cat > "$CTAN_NOTES" <<EOF
17+
The release files are signed using a detached signature. You can obtain the
18+
signature from the GitHub release page
19+
20+
https://github.com/pgf-tikz/pgf/releases/download/${GIT_TAG}/pgf_${GIT_TAG}.ctan.flatdir.zip.sig
21+
22+
$(cat doc/generic/pgf/CTAN_NOTES.md)
23+
EOF
24+
25+
curl \
26+
-F "update=true" \
27+
-F "pkg=pgf" \
28+
-F "version=${GIT_TAG}" \
29+
-F "author=Christian Feuersänger" \
30+
-F "author=Henri Menke" \
31+
-F "author=The PGF/TikZ Team" \
32+
-F "author=Till Tantau" \
33+
-F "uploader=github-actions" \
34+
-F "email=pgf-tikz@tug.org" \
35+
-F "summary=Create PostScript and PDF graphics in TeX" \
36+
-F "description=<doc/generic/pgf/description.html" \
37+
-F "ctanPath=/graphics/pgf/base" \
38+
-F "announcement=<doc/generic/pgf/RELEASE_NOTES.md" \
39+
-F "note=<$CTAN_NOTES" \
40+
-F "license=fdl" \
41+
-F "license=gpl2" \
42+
-F "license=lppl1.3c" \
43+
-F "file=@pgf_${GIT_TAG}.ctan.flatdir.zip" \
44+
-F "bugs=https://github.com/pgf-tikz/pgf/issues" \
45+
-F "support=https://tug.org/mailman/listinfo/pgf-tikz" \
46+
-F "repository=https://github.com/pgf-tikz/pgf" \
47+
"https://www.ctan.org/submit/$1"

doc/generic/pgf/CTAN_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

doc/generic/pgf/description.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<p>PGF is a macro package for creating graphics. It is platform- and format-independent and works together with the most important TeX backend drivers, including pdfTeX and dvips. It comes with a user-friendly syntax layer called TikZ.<br></p><p>Its usage is similar to <a data-cke-saved-href="/pkg/pstricks-base" href="/pkg/pstricks-base">pstricks</a> and the standard picture environment. PGF works with plain (pdf-)TeX, (pdf-)LaTeX, and ConTeXt. Unlike <a data-cke-saved-href="/pkg/pstricks-base" href="/pkg/pstricks-base">pstricks</a>, it can produce either PostScript or PDF output.<br></p>

0 commit comments

Comments
 (0)