72 lines
2.0 KiB
YAML
72 lines
2.0 KiB
YAML
name: Build Typst PDF
|
|
run-name: Build PDF for ${{ gitea.actor }} on master
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install FiraCode Nerd Font
|
|
run: |
|
|
mkdir -p fonts
|
|
wget -qO FiraCode.zip https://github.com/ryanoasis/nerd-fonts/releases/latest/download/FiraCode.zip
|
|
unzip -q FiraCode.zip -d fonts
|
|
|
|
- name: Install Typst CLI
|
|
run: |
|
|
wget -qO- https://github.com/typst/typst/releases/latest/download/typst-x86_64-unknown-linux-musl.tar.xz | tar -xJ
|
|
mv typst-x86_64-unknown-linux-musl/typst /usr/local/bin/typst
|
|
chmod +x /usr/local/bin/typst
|
|
|
|
- name: Run Build Script
|
|
env:
|
|
TYPST_FONT_PATHS: ./fonts
|
|
run: |
|
|
chmod +x build.sh
|
|
./build.sh
|
|
|
|
- name: Delete Old Nightly Release & Tag
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
curl -X DELETE \
|
|
-H "Authorization: token $GITHUB_TOKEN" \
|
|
"$GITHUB_API_URL/repos/${{ gitea.repository }}/releases/tags/nightly" || true
|
|
|
|
git tag -d nightly || true
|
|
git push origin :nightly || true
|
|
|
|
- name: Create Nightly Tag
|
|
run: |
|
|
git config user.name "Gitea Actions"
|
|
git config user.email "actions@gitea.local"
|
|
git tag nightly
|
|
git push origin nightly
|
|
|
|
- name: Publish Nightly Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
tag_name: nightly
|
|
name: Nightly Build
|
|
body: |
|
|
**Automated Nightly Build**
|
|
Triggered by commit: `${{ gitea.sha }}`
|
|
Date: ${{ gitea.event.head_commit.timestamp }}
|
|
files: build/*.pdf
|
|
prerelease: true
|
|
draft: false
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|