Skip to content

Update latest experience. #99

Update latest experience.

Update latest experience. #99

Workflow file for this run

name: Create Release
on:
workflow_dispatch:
inputs:
tags:
description: 'Version'
required: true
type: string
default: 'v'
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
version:
name: Compute Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.VERSION }}
steps:
- name: Get tag from GITHUB_REF
id: github_ref
run: |
echo "::debug::GITHUB_REF=${GITHUB_REF}"
echo "PUSH_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Set release name based on originating event
id: get_version
run: |
echo "::debug::PUSH_TAG=${{steps.github_ref.outputs.PUSH_TAG}}"
echo "::debug::INPUT_VERSION=${{inputs.tags}}"
if [[ "${{github.event_name}}" == "workflow_dispatch" ]];
then computed_version="${{inputs.tags}}";
else computed_version="${{steps.github_ref.outputs.PUSH_TAG}}";
fi
echo "VERSION=$computed_version" >> $GITHUB_OUTPUT
echo "::debug::Version evaluated to $computed_version"
release:
name: Create Release for Version
needs: version
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Echo cv-maxpowis-{version}.tex
run: echo "::debug::Writing '\def\releasenumber{${{ needs.version.outputs.version }}}\def\releaseurl{https://github.com/maxpowis/cv/releases/tag/${{ needs.version.outputs.version }}}\input{cv}' to cv-maxpowis-${{ needs.version.outputs.version }}.tex"
- name: Create cv-maxpowis-{version}.tex
uses: finnp/create-file-action@2.0.0
env:
FILE_NAME: "cv-maxpowis-${{ needs.version.outputs.version }}.tex"
FILE_DATA: '\def\releasenumber{${{ needs.version.outputs.version }}}\def\releaseurl{https://github.com/maxpowis/cv/releases/tag/${{ needs.version.outputs.version }}}\input{cv}'
- name: Create cv-maxpowis-{version}_DARK.tex
uses: finnp/create-file-action@2.0.0
env:
FILE_NAME: "cv-maxpowis-${{ needs.version.outputs.version }}_DARK.tex"
FILE_DATA: '\def\darkmode{}\def\releasenumber{${{ needs.version.outputs.version }}}\def\releaseurl{https://github.com/maxpowis/cv/releases/tag/${{ needs.version.outputs.version }}}\input{cv}'
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v3
with:
root_file: |
cv-maxpowis-${{ needs.version.outputs.version }}.tex
cv-maxpowis-${{ needs.version.outputs.version }}_DARK.tex
latexmk_use_lualatex: true
- name: Create release with assets
id: create_release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ needs.version.outputs.version }}
name: Release ${{ needs.version.outputs.version }}
draft: false
prerelease: false
generate_release_notes: true
files: |
cv-maxpowis-${{ needs.version.outputs.version }}.pdf
cv-maxpowis-${{ needs.version.outputs.version }}_DARK.pdf
- name: Echo release info
run: echo "::debug::Created release with url=${{ steps.create_release.outputs.url }}; id=${{ steps.create_release.outputs.id }}; upload_url=${{ steps.create_release.outputs.upload_url }}"
- name: Trigger workflow 'Publish PDF release to website'
uses: peter-evans/repository-dispatch@v2.1.2
if: ${{ github.event_name=='push' }}
with:
token: ${{ secrets.API_TOKEN_GITHUB }}
event-type: dispatch_publish