diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5ee297649a9db588612e8dbaff85c5d9fab849c4..e08e99ded9d3c1a6bbc8601915465f08b5925aba 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,11 +15,19 @@ # adnrv/texlive # LATEX_IMAGE: listx/texlive:2020 +stages: + - build + - release + build-windows: stage: build tags: - windows - latex + before_script: + - echo $CI_JOB_ID + # Writing GE_JOB_ID variable to environment file, will need the value in the next stage. + - echo BUILD_JOB_ID=$CI_JOB_ID >> build-windows.env script: # prepare all possible variants of the thesis - (Get-Content ./Example.tex -Raw) -Replace 'ThesisType.=.{\w*}', 'ThesisType = {SEM}' | Set-Content ./Example_SEM.tex @@ -29,12 +37,41 @@ build-windows: - (Get-Content ./Example.tex -Raw) -Replace 'ThesisType.=.{\w*}', 'ThesisType = {PHD}' | Set-Content ./Example_PHD.tex # remove Example.tex - no need to compile it now - rm ./Example.tex + - rm ./Example.pdf # compile all .tex files - latexmk -pdf artifacts: paths: - "*.pdf" + reports: + # To ensure we've access to this file in the next stage + dotenv: build-windows.env + +release-windows: + stage: release + tags: + - windows + - latex + needs: + - job: build-windows + artifacts: true + variables: + TAG: '$CI_COMMIT_SHA' + script: + - echo "Create Release $TAG" + - echo $JOB_ID + release: + name: 'Release $TAG' + tag_name: '$TAG' + ref: '$TAG' + description: 'Release $TAG' + assets: + links: + - name: "Thesis examples.zip" + url: "git.ift.tuwien.ac.at/lab/pub/ift-latex/-/jobs/${BUILD_JOB_ID}/artifacts/download" + + #release: # stage: release @@ -50,5 +87,5 @@ build-windows: # links: # - name: 'Compiled example thesis' # https://example.com///-/jobs/artifacts//download?job= -# +#https://git.ift.tuwien.ac.at/lab/pub/ift-latex/-/jobs/524/artifacts/download?file_type=archive # url: 'https://git.ift.tuwien.ac.at/lab/pub/ift-latex/-/jobs/${GE_JOB_ID}/artifacts/file/*.pdf'