forked from xuyuan/pgf-pie
-
Notifications
You must be signed in to change notification settings - Fork 9
195 lines (175 loc) · 7.03 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
name: CI
on:
push:
pull_request:
schedule:
- cron: '0 8 * * 3' # Every Wednesday at 08:00
jobs:
build:
runs-on: ubuntu-latest
container:
image: registry.gitlab.com/islandoftex/images/texlive:latest
strategy:
matrix:
engine: [pdflatex, lualatex, xelatex]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# `actions/checkout` default input `set-safe-directory: true` doesn't work
# for containers.
# see for example https://github.com/actions/checkout/issues/766
- name: Fixup Run actions/checkout
run: git config --global --add safe.directory '*'
- name: 'Install pgf-pie'
run: |
tlmgr init-usertree --usertree $PWD
echo "TEXMFHOME=$PWD" >> $GITHUB_ENV
- name: 'Get the revision'
run: |
echo "GIT_TAG=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV
- name: 'Build the manual'
run: |
cd doc/latex/pgf-pie
while : ; do
${{ matrix.engine }}-dev -shell-escape -halt-on-error -interaction=nonstopmode pgf-pie-manual.tex
grep -q -E "(There were undefined references|Rerun to get (cross-references|the bars) right)" *.log || break
[ "$(( thisrun=$(( thisrun + 1 )) ))" -lt 5 ] || { echo "Reruns exceeded"; exit 1; }
done
if [ "${{ matrix.engine }}" = "latex" ]; then
dvips pgf-pie-manual.dvi
ps2pdf pgf-pie-manual.ps
fi
cd -
- name: 'ZIP: Build'
run: |
git ls-files | sed '/^\./d;/^ci/d' | tee FILES
echo doc/latex/pgf-pie/pgf-pie-manual.pdf | tee -a FILES
tar --xform='s$\(doc\|tex\)/latex/pgf-pie/$$g' \
--xform='s$^$pgf-pie/$g' \
-czvf pgf-pie_${GIT_TAG}.tar.gz $(cat FILES)
- name: "ZIP: Sign"
if: |
matrix.engine == 'pdflatex' &&
github.event_name != 'pull_request' &&
env.GPG_SECRET_KEY != null
env:
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
run: |
# get the keys
printenv GPG_SECRET_KEY > "pgf-${GIT_TAG}.sec"
printenv GPG_PUBLIC_KEY > "pgf-${GIT_TAG}.pub"
# sign the products
export GNUPGHOME=$(mktemp -d)
install -dm 0700 "$GNUPGHOME"
gpg --import "pgf-${GIT_TAG}.sec"
gpg --armor --output "pgf-pie_${GIT_TAG}.tar.gz.sig" --detach-sign "pgf-pie_${GIT_TAG}.tar.gz"
rm -rf "$GNUPGHOME"
# verify the signature against the distributed public key
export GNUPGHOME=$(mktemp -d)
install -dm 0700 "$GNUPGHOME"
gpg --import "pgf-${GIT_TAG}.pub"
gpg --verify "pgf-pie_${GIT_TAG}.tar.gz.sig"
rm -rf "$GNUPGHOME"
- name: "Release: create"
uses: actions/create-release@v1
id: create_release
if: matrix.engine == 'pdflatex' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.GIT_TAG }}
release_name: ${{ env.GIT_TAG }}
body_path: doc/latex/pgf-pie/RELEASE_NOTES.md
- name: "Release: upload manual"
uses: actions/upload-release-asset@v1
if: matrix.engine == 'pdflatex' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: doc/latex/pgf-pie/pgf-pie-manual.pdf
asset_name: pgf-pie-manual-${{ env.GIT_TAG }}.pdf
asset_content_type: application/pdf
- name: "Release: upload public key"
uses: actions/upload-release-asset@v1
if: matrix.engine == 'pdflatex' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./pgf-${{ env.GIT_TAG }}.pub
asset_name: pgf-${{ env.GIT_TAG }}.pub
asset_content_type: text/plain
- name: "Release: upload ZIP"
uses: actions/upload-release-asset@v1
if: matrix.engine == 'pdflatex' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./pgf-pie_${{ env.GIT_TAG }}.tar.gz
asset_name: pgf-pie_${{ env.GIT_TAG }}.tar.gz
asset_content_type: application/gzip
- name: "Release: upload ZIP signature"
uses: actions/upload-release-asset@v1
if: matrix.engine == 'pdflatex' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./pgf-pie_${{ env.GIT_TAG }}.tar.gz.sig
asset_name: pgf-pie_${{ env.GIT_TAG }}.tar.gz.sig
asset_content_type: text/plain
- name: "CTAN: Validate"
if: matrix.engine == 'pdflatex'
uses: pgf-tikz/actions/ctan-upload@master
with:
action: validate
announcement: doc/latex/pgf-pie/RELEASE_NOTES.md
author: 'The PGF/TikZ Team;Xu Yuan'
bugs: https://github.com/pgf-tikz/pgf-pie/issues
ctanPath: /graphics/pgf/contrib/pgf-pie
description: doc/latex/pgf-pie/description.html
email: [email protected]
file: 'pgf-pie_${{ env.GIT_TAG }}.tar.gz'
license: 'gpl2;lppl1.3c'
note: |
The release files are signed using a detached signature. You can obtain the
signature from the GitHub release page
https://github.com/pgf-tikz/pgf-pie/releases/download/${{ env.GIT_TAG }}/pgf-pie_${{ env.GIT_TAG }}.tar.gz.sig
pkg: pgf-pie
repository: https://github.com/pgf-tikz/pgf-pie
summary: Draw pie charts, using PGF
support: https://tug.org/mailman/listinfo/pgf-tikz
update: true
uploader: github-actions
version: ${{ env.GIT_TAG }}
- name: "CTAN: Upload"
if: |
matrix.engine == 'pdflatex' &&
startsWith(github.ref, 'refs/tags/') &&
github.repository == 'pgf-tikz/pgf-pie'
uses: pgf-tikz/actions/ctan-upload@master
with:
action: upload
announcement: doc/latex/pgf-pie/RELEASE_NOTES.md
author: 'The PGF/TikZ Team;Xu Yuan'
bugs: https://github.com/pgf-tikz/pgf-pie/issues
ctanPath: /graphics/pgf/contrib/pgf-pie
description: doc/latex/pgf-pie/description.html
email: [email protected]
file: 'pgf-pie_${{ env.GIT_TAG }}.tar.gz'
license: 'gpl2;lppl1.3c'
note: |
The release files are signed using a detached signature. You can obtain the
signature from the GitHub release page
https://github.com/pgf-tikz/pgf-pie/releases/download/${{ env.GIT_TAG }}/pgf-pie_${{ env.GIT_TAG }}.tar.gz.sig
pkg: pgf-pie
repository: https://github.com/pgf-tikz/pgf-pie
summary: Draw pie charts, using PGF
support: https://tug.org/mailman/listinfo/pgf-tikz
update: true
uploader: github-actions
version: ${{ env.GIT_TAG }}