Skip to content

Commit c9ab78b

Browse files
committed
CI: Create release from tag
1 parent 5d1f4e0 commit c9ab78b

File tree

2 files changed

+48
-4
lines changed

2 files changed

+48
-4
lines changed

.github/workflows/main.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
run: |
4949
sudo apt-get update
5050
sudo apt-get install -yy libxml-parser-perl libxml-xpath-perl libtext-unidecode-perl
51+
texlua build.lua tds
5152
texlua build.lua ctan
5253
cp doc/generic/pgf/version-for-luatex/en/pgfmanual.pdf ../
5354
bash ci/update_tlcontrib.sh
@@ -57,3 +58,46 @@ jobs:
5758
with:
5859
name: ctanzip
5960
path: pgf_*.zip
61+
62+
- name: Get tag for release
63+
if: matrix.engine == 'luatex' && startsWith(github.ref, 'refs/tags/')
64+
run: echo "GIT_TAG=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV
65+
66+
- uses: actions/create-release@v1
67+
id: create_release
68+
if: matrix.engine == 'luatex' && startsWith(github.ref, 'refs/tags/')
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
with:
72+
tag_name: ${{ env.GIT_TAG }}
73+
release_name: ${{ env.GIT_TAG }}
74+
75+
- uses: actions/upload-release-asset@v1
76+
if: matrix.engine == 'luatex' && startsWith(github.ref, 'refs/tags/')
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
with:
80+
upload_url: ${{ steps.create_release.outputs.upload_url }}
81+
asset_path: doc/generic/pgf/version-for-${{ matrix.engine }}/en/pgfmanual.pdf
82+
asset_name: pgfmanual.pdf
83+
asset_content_type: application/pdf
84+
85+
- uses: actions/upload-release-asset@v1
86+
if: matrix.engine == 'luatex' && startsWith(github.ref, 'refs/tags/')
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
with:
90+
upload_url: ${{ steps.create_release.outputs.upload_url }}
91+
asset_path: ./pgf_${{ env.GIT_TAG }}.tds.zip
92+
asset_name: pgf_${{ env.GIT_TAG }}.tds.zip
93+
asset_content_type: application/zip
94+
95+
- uses: actions/upload-release-asset@v1
96+
if: matrix.engine == 'luatex' && startsWith(github.ref, 'refs/tags/')
97+
env:
98+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99+
with:
100+
upload_url: ${{ steps.create_release.outputs.upload_url }}
101+
asset_path: ./pgf_${{ env.GIT_TAG }}.ctan.flatdir.zip
102+
asset_name: pgf_${{ env.GIT_TAG }}.ctan.flatdir.zip
103+
asset_content_type: application/zip

ci/texlive.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fi
1111
OWNPATH=$(cd -P -- "$(dirname -- "$SCRIPTPATH")" && pwd -P)
1212

1313
export PATH=/tmp/texlive/bin/x86_64-linux:$PATH
14-
echo "::add-path::/tmp/texlive/bin/x86_64-linux"
14+
echo "/tmp/texlive/bin/x86_64-linux" >> ${GITHUB_PATH:-/dev/null}
1515

1616
# Check for cached version
1717
if ! command -v texlua > /dev/null; then
@@ -99,6 +99,6 @@ tlmgr option -- autobackup 0
9999
tlmgr update --self --all --no-auto-install
100100

101101
# Install PGF
102-
tlmgr init-usertree --usertree "$(readlink -f ..)"
103-
export TEXMFHOME=$(readlink -f ..)
104-
echo "::set-env name=TEXMFHOME::$(pwd)"
102+
tlmgr init-usertree --usertree "$(readlink -e ..)"
103+
export TEXMFHOME=$(readlink -e ..)
104+
echo "TEXMFHOME=$(pwd)" >> ${GITHUB_ENV:-/dev/null}

0 commit comments

Comments
 (0)