Skip to content

Commit

Permalink
CI: Create release from tag
Browse files Browse the repository at this point in the history
  • Loading branch information
hmenke committed Nov 23, 2020
1 parent 5d1f4e0 commit c9ab78b
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 4 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -yy libxml-parser-perl libxml-xpath-perl libtext-unidecode-perl
texlua build.lua tds
texlua build.lua ctan
cp doc/generic/pgf/version-for-luatex/en/pgfmanual.pdf ../
bash ci/update_tlcontrib.sh
Expand All @@ -57,3 +58,46 @@ jobs:
with:
name: ctanzip
path: pgf_*.zip

- name: Get tag for release
if: matrix.engine == 'luatex' && startsWith(github.ref, 'refs/tags/')
run: echo "GIT_TAG=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV

- uses: actions/create-release@v1
id: create_release
if: matrix.engine == 'luatex' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.GIT_TAG }}
release_name: ${{ env.GIT_TAG }}

- uses: actions/upload-release-asset@v1
if: matrix.engine == 'luatex' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: doc/generic/pgf/version-for-${{ matrix.engine }}/en/pgfmanual.pdf
asset_name: pgfmanual.pdf
asset_content_type: application/pdf

- uses: actions/upload-release-asset@v1
if: matrix.engine == 'luatex' && 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 }}.tds.zip
asset_name: pgf_${{ env.GIT_TAG }}.tds.zip
asset_content_type: application/zip

- uses: actions/upload-release-asset@v1
if: matrix.engine == 'luatex' && 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 }}.ctan.flatdir.zip
asset_name: pgf_${{ env.GIT_TAG }}.ctan.flatdir.zip
asset_content_type: application/zip
8 changes: 4 additions & 4 deletions ci/texlive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fi
OWNPATH=$(cd -P -- "$(dirname -- "$SCRIPTPATH")" && pwd -P)

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

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

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

0 comments on commit c9ab78b

Please sign in to comment.