This commit is contained in:
@@ -9,9 +9,14 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install FiraCode Nerd Font
|
- name: Install FiraCode Nerd Font
|
||||||
run: |
|
run: |
|
||||||
@@ -21,29 +26,34 @@ jobs:
|
|||||||
|
|
||||||
- name: Install Typst CLI
|
- name: Install Typst CLI
|
||||||
run: |
|
run: |
|
||||||
# Download the latest CLI binary for Linux
|
|
||||||
wget -qO- https://github.com/typst/typst/releases/latest/download/typst-x86_64-unknown-linux-musl.tar.xz | tar -xJ
|
wget -qO- https://github.com/typst/typst/releases/latest/download/typst-x86_64-unknown-linux-musl.tar.xz | tar -xJ
|
||||||
|
|
||||||
# Move binary to path (assuming standard Linux runner)
|
|
||||||
mv typst-x86_64-unknown-linux-musl/typst /usr/local/bin/typst
|
mv typst-x86_64-unknown-linux-musl/typst /usr/local/bin/typst
|
||||||
chmod +x /usr/local/bin/typst
|
chmod +x /usr/local/bin/typst
|
||||||
|
|
||||||
- name: Run Build Script
|
- name: Run Build Script
|
||||||
# We set the Environment Variable TYPST_FONT_PATHS so Typst knows where to look
|
|
||||||
env:
|
env:
|
||||||
TYPST_FONT_PATHS: ./fonts
|
TYPST_FONT_PATHS: ./fonts
|
||||||
run: |
|
run: |
|
||||||
chmod +x build.sh
|
chmod +x build.sh
|
||||||
./build.sh
|
./build.sh
|
||||||
- name: Update Nightly Tag
|
|
||||||
# This moves the 'nightly' tag to the current commit
|
- 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: |
|
run: |
|
||||||
git config user.name "Gitea Actions"
|
git config user.name "Gitea Actions"
|
||||||
git config user.email "actions@gitea.local"
|
git config user.email "actions@gitea.local"
|
||||||
# Force create/move the tag locally
|
git tag nightly
|
||||||
git tag -f nightly
|
git push origin nightly
|
||||||
# Force push the tag to the remote
|
|
||||||
git push -f origin nightly
|
|
||||||
|
|
||||||
- name: Publish Nightly Release
|
- name: Publish Nightly Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
@@ -52,7 +62,6 @@ jobs:
|
|||||||
name: Nightly Build
|
name: Nightly Build
|
||||||
body: |
|
body: |
|
||||||
**Automated Nightly Build**
|
**Automated Nightly Build**
|
||||||
|
|
||||||
Triggered by commit: `${{ gitea.sha }}`
|
Triggered by commit: `${{ gitea.sha }}`
|
||||||
Date: ${{ gitea.event.head_commit.timestamp }}
|
Date: ${{ gitea.event.head_commit.timestamp }}
|
||||||
files: build/*.pdf
|
files: build/*.pdf
|
||||||
|
|||||||
Reference in New Issue
Block a user