Skip to content

Commit 1fe1c57

Browse files
committed
ci update
1 parent ca99b95 commit 1fe1c57

File tree

3 files changed

+39
-28
lines changed

3 files changed

+39
-28
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ jobs:
2828
- name: Setup dependencies
2929
run: |
3030
sudo apt update
31-
sudo apt install texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended xsltproc latexmk cm-super texlive-extra-utils
31+
sudo apt install texlive-latex-base texlive-latex-recommended \
32+
texlive-latex-extra texlive-fonts-recommended \
33+
librsvg2-bin latexmk \
34+
pdftk xsltproc latexmk cm-super
3235
3336
- name: Build the document
3437
run: make
@@ -39,7 +42,7 @@ jobs:
3942
test -f ${{ env.doc_name }}.bbl
4043
4144
- name: Keep the PDF artefact
42-
uses: actions/upload-artifact@v1
45+
uses: actions/upload-artifact@v4
4346
with:
4447
name: PDF Preview
4548
path: ${{ env.doc_name }}.pdf

.github/workflows/preview.yml

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
name: Update PDF Preview
88

99
env:
10-
doc_name: data-origin
10+
doc_name : data-origin
11+
branch_name: ${{ github.head_ref || github.ref_name }}
12+
tag_preview: auto-pdf-preview
1113

1214
on:
1315
push:
@@ -22,15 +24,17 @@ jobs:
2224
steps:
2325

2426
- name: Checkout the repository
25-
uses: actions/checkout@v1
27+
uses: actions/checkout@v4
2628
with:
2729
submodules: true
2830

2931
- name: Setup dependencies
3032
run: |
3133
sudo apt update
32-
sudo apt install texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended xsltproc latexmk cm-super texlive-extra-utils
33-
sudo snap install pdftk
34+
sudo apt install texlive-latex-base texlive-latex-recommended \
35+
texlive-latex-extra texlive-fonts-recommended \
36+
librsvg2-bin latexmk \
37+
pdftk xsltproc latexmk cm-super
3438
3539
- name: Build the document
3640
run: make ${{ env.doc_name }}-draft.pdf
@@ -40,27 +44,31 @@ jobs:
4044
test -f ${{ env.doc_name }}-draft.pdf
4145
test -f ${{ env.doc_name }}.bbl
4246
43-
- name: Move the auto-pdf-preview tag
44-
uses: weareyipyip/walking-tag-action@v2
45-
with:
46-
tag-name: auto-pdf-preview
47-
tag-message: |
48-
Last commit taken into account for the automatically updated PDF preview of this IVOA document.
47+
- name: Remove the former PDF preview (if any)
48+
run: |
49+
existingTag=$( gh release list --exclude-drafts --json 'isPrerelease,tagName' \
50+
--jq '.[] | select(.isPrerelease == true and .tagName == "${{ env.tag_preview }}") | .tagName' \
51+
| xargs -n 1 echo )
52+
if [ -n "$existingTag" ];
53+
then
54+
gh release delete --cleanup-tag "$existingTag"
55+
fi
4956
env:
50-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5158

52-
- name: Update the PDF preview
53-
uses: Xotl/cool-github-releases@v1
54-
with:
55-
mode: update
56-
isPrerelease: true
57-
tag_name: auto-pdf-preview
58-
release_name: "Auto PDF Preview"
59-
body_mrkdwn: |
60-
This release aims to provide a PDF preview of the last commit applied on this repository.
59+
- name: Upload the new PDF preview
60+
run: |
61+
RELEASE_NOTES="This release aims to provide a PDF preview of the last commit applied on this repository.
6162
It will be updated automatically after each merge of a PullRequest.
62-
**DO NOT PUBLISH THIS PRE-RELEASE!**"
63-
_Corresponding commit: ${{ github.sha }}_
64-
assets: ${{ env.doc_name }}-draft.pdf
65-
replace_assets: true
66-
github_token: ${{ secrets.GITHUB_TOKEN }}
63+
**DO NOT PUBLISH THIS PRE-RELEASE!**
64+
_Corresponding commit: ${{ github.sha }}_"
65+
66+
gh release create ${{ env.tag_preview }} \
67+
${{ env.doc_name }}-draft.pdf \
68+
--prerelease \
69+
--target "${{ env.branch_name }}" \
70+
--title 'Auto PDF Preview' \
71+
--notes "$RELEASE_NOTES"
72+
env:
73+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+

0 commit comments

Comments
 (0)