From c9ab78bf4be977d7e06b16190769138f096b33b2 Mon Sep 17 00:00:00 2001 From: Henri Menke Date: Sat, 21 Nov 2020 20:06:51 +0100 Subject: [PATCH] CI: Create release from tag --- .github/workflows/main.yml | 44 ++++++++++++++++++++++++++++++++++++++ ci/texlive.sh | 8 +++---- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7e9c8808f..c6645bbf2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 @@ -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 diff --git a/ci/texlive.sh b/ci/texlive.sh index 96d6fa25a..4e499ebea 100644 --- a/ci/texlive.sh +++ b/ci/texlive.sh @@ -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 @@ -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}