CI #77
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | |