Skip to content

Commit f8d53bd

Browse files
authored
Update CI workflows (#103)
* Update ivoatex * Update CI for build and PDF preview
1 parent 69cb15b commit f8d53bd

File tree

3 files changed

+60
-46
lines changed

3 files changed

+60
-46
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# This file generated from a template file maintained in the ivoatex repository.
2+
# To create and install it into a project repository, do:
3+
# make github-preview
4+
# git commit
5+
# git push
6+
#
17
name: Check the IVOA document
28

39
env:
@@ -11,29 +17,31 @@ jobs:
1117
build:
1218

1319
runs-on: ubuntu-latest
14-
20+
1521
steps:
16-
22+
1723
- name: Checkout the repository
18-
uses: actions/checkout@v1
24+
uses: actions/checkout@v4
1925
with:
2026
submodules: true
21-
27+
2228
- name: Setup dependencies
2329
run: |
2430
sudo apt update
25-
sudo apt install texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended xsltproc
26-
31+
sudo apt install texlive-latex-base texlive-latex-recommended \
32+
texlive-latex-extra texlive-fonts-recommended \
33+
pdftk xsltproc latexmk cm-super
34+
2735
- name: Build the document
28-
run: make biblio forcetex
29-
36+
run: make
37+
3038
- name: Check the output
3139
run: |
3240
test -f ${{ env.doc_name }}.pdf
3341
test -f ${{ env.doc_name }}.bbl
34-
35-
- name: Keep the PDF artefact
36-
uses: actions/upload-artifact@v1
42+
43+
- name: Keep the PDF artefact
44+
uses: actions/upload-artifact@v4
3745
with:
3846
name: PDF Preview
3947
path: ${{ env.doc_name }}.pdf

.github/workflows/preview.yml

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1+
# This file generated from a template file maintained in the ivoatex repository.
2+
# To create and install it into a project repository, do:
3+
# make github-preview
4+
# git commit
5+
# git push
6+
#
17
name: Update PDF Preview
28

39
env:
4-
doc_name: ADQL
10+
doc_name : ADQL
11+
branch_name: ${{ github.head_ref || github.ref_name }}
12+
tag_preview: auto-pdf-preview
513

614
on:
715
push:
@@ -10,51 +18,49 @@ on:
1018

1119
jobs:
1220
build:
13-
21+
1422
runs-on: ubuntu-latest
15-
23+
1624
steps:
17-
25+
1826
- name: Checkout the repository
19-
uses: actions/checkout@v1
27+
uses: actions/checkout@v4
2028
with:
2129
submodules: true
22-
30+
2331
- name: Setup dependencies
2432
run: |
25-
sudo apt update
26-
sudo apt install texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended xsltproc
27-
sudo snap install pdftk
28-
33+
sudo apt install texlive-latex-base texlive-latex-recommended \
34+
texlive-latex-extra texlive-fonts-recommended \
35+
pdftk xsltproc latexmk cm-super
36+
2937
- name: Build the document
3038
run: make biblio ${{ env.doc_name }}-draft.pdf
31-
39+
3240
- name: Check the output
3341
run: |
3442
test -f ${{ env.doc_name }}-draft.pdf
3543
test -f ${{ env.doc_name }}.bbl
36-
37-
- name: Move the auto-pdf-preview tag
38-
uses: weareyipyip/walking-tag-action@v2
39-
with:
40-
tag-name: auto-pdf-preview
41-
tag-message: |
42-
Last commit taken into account for the automatically updated PDF preview of this IVOA document.
44+
45+
- name: Remove the former PDF preview
46+
run: |
47+
gh release delete ${{ env.tag_preview }} --cleanup-tag --yes
4348
env:
44-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45-
46-
- name: Update the PDF preview
47-
uses: Xotl/cool-github-releases@v1
48-
with:
49-
mode: update
50-
isPrerelease: true
51-
tag_name: auto-pdf-preview
52-
release_name: "Auto PDF Preview"
53-
body_mrkdwn: |
54-
This release aims to provide a PDF preview of the last commit applied on this repository.
49+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- name: Upload the new PDF preview
52+
run: |
53+
RELEASE_NOTES="This release aims to provide a PDF preview of the last commit applied on this repository.
5554
It will be updated automatically after each merge of a PullRequest.
56-
**DO NOT PUBLISH THIS PRE-RELEASE!**"
57-
_Corresponding commit: ${{ github.sha }}_
58-
assets: ${{ env.doc_name }}-draft.pdf
59-
replace_assets: true
60-
github_token: ${{ secrets.GITHUB_TOKEN }}
55+
**DO NOT PUBLISH THIS PRE-RELEASE!**
56+
_Corresponding commit: ${{ github.sha }}_"
57+
58+
gh release create ${{ env.tag_preview }} \
59+
${{ env.doc_name }}-draft.pdf \
60+
--prerelease \
61+
--target "${{ env.branch_name }}" \
62+
--title 'Auto PDF Preview' \
63+
--notes "$RELEASE_NOTES"
64+
env:
65+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+

0 commit comments

Comments
 (0)