fix: protect uvec in caption context #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- '.gitignore' | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- '**.md' | |
- '.gitignore' | |
workflow_dispatch: | |
jobs: | |
ubuntu: | |
name: Quake III DeFRaG Physics | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build | |
uses: xu-cheng/latex-action@v2 | |
with: | |
root_file: main.tex | |
latexmk_shell_escape: true | |
latexmk_use_lualatex: true | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: artifact | |
path: main.pdf | |
if-no-files-found: error | |
retention-days: 5 | |
release: | |
name: Release | |
if: github.ref == 'refs/heads/master' | |
needs: ubuntu | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
path: bin/ | |
- uses: actions/github-script@v6 | |
id: script | |
with: | |
script: | | |
// delete latest release | |
try { | |
const release = await github.rest.repos.getReleaseByTag({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
tag: "latest", | |
}); | |
console.log(`Found latest release`) | |
await github.rest.repos.deleteRelease({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
release_id: release.data.id, | |
}); | |
console.log(`Deleted latest release`); | |
} catch (e) { | |
console.log(`Failed deleting latest release: ${e.message}`); | |
} | |
// create/update 'latest' tag | |
try { | |
await github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: "refs/tags/latest", | |
sha: context.sha, | |
}); | |
console.log(`Created new \`latest\` tag`); | |
} catch (e) { | |
await github.rest.git.updateRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: "tags/latest", | |
sha: context.sha, | |
}); | |
console.log(`Updated \`latest\` tag`); | |
} | |
- uses: softprops/action-gh-release@v1 | |
with: | |
body: "Quake III DeFRaG Physics" | |
draft: false | |
prerelease: false | |
files: | | |
bin/main.pdf | |
name: Latest pdf | |
tag_name: latest | |
token: ${{ secrets.GITHUB_TOKEN }} |