Compare commits
10 Commits
fix/center
...
main
Author | SHA1 | Date |
---|---|---|
Sven Vogel | 44d995fd28 | |
Sven Vogel | b0fc412b57 | |
Sven Vogel | 4bb731ca66 | |
Sven Vogel | faf7d24677 | |
Sven Vogel | 08602bc9ab | |
Sven Vogel | bcc5d6ba22 | |
Sven Vogel | b4e87c0d1b | |
Sven Vogel | 6572d67320 | |
Sven Vogel | 36f8ffdc4b | |
Sven Vogel | 9e3567a0df |
|
@ -1,10 +1,20 @@
|
||||||
name: Gitea Action for checking typst compilation
|
name: Build'n check
|
||||||
run-name: Performing Typst compilation
|
run-name: Performing Typst compilation
|
||||||
on: [push]
|
on:
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
jobs:
|
jobs:
|
||||||
run-ci-linux:
|
run-ci-linux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
# run action mutally exclusive on PRs or
|
||||||
|
# push with commit containing "Run-Checks"
|
||||||
|
if: >
|
||||||
|
(contains(github.event.head_commit.message, 'Run-Checks') &&
|
||||||
|
github.event_name == 'push')
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
@ -16,5 +26,9 @@ jobs:
|
||||||
uses: cachix/install-nix-action@v27
|
uses: cachix/install-nix-action@v27
|
||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
- name: Run CI
|
- name: Stylecheck
|
||||||
run: nix-shell --run ./run-ci.sh
|
run: nix-shell --run "./run-fmt.sh --check src/lib.typ"
|
||||||
|
- id: build
|
||||||
|
name: Build
|
||||||
|
run: |
|
||||||
|
nix-shell --run ./run-ci.sh
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
name: release
|
name: Build'n check
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
branches:
|
||||||
- 'v*.*.*'
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
build:
|
||||||
|
name: Check Template and Build example
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
|
@ -19,16 +18,60 @@ jobs:
|
||||||
uses: cachix/install-nix-action@v27
|
uses: cachix/install-nix-action@v27
|
||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
- name: Run CI
|
- name: Stylecheck
|
||||||
run: nix-shell --run ./run-ci.sh
|
run: nix-shell --run "./run-fmt.sh --check src/lib.typ"
|
||||||
|
- id: build
|
||||||
|
name: Build
|
||||||
|
run: |
|
||||||
|
nix-shell --run ./run-ci.sh
|
||||||
|
- name: Upload artifact
|
||||||
|
id: artifact-upload
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: example-document
|
||||||
|
path: ${{ github.workspace }}/example.pdf
|
||||||
|
if-no-files-found: error
|
||||||
|
retention-days: 1
|
||||||
|
- name: Output artifact ID
|
||||||
|
run: echo 'Artifact ID is ${{ steps.artifact-upload.outputs.artifact-id }}'
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
if: contains(github.event.head_commit.message, 'Release-As:')
|
||||||
|
env:
|
||||||
|
USERNAME: servostar
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v3
|
||||||
- name: Setup go
|
- name: Setup go
|
||||||
uses: https://github.com/actions/setup-go@v4
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: '>=1.20.1'
|
go-version: '>=1.20.1'
|
||||||
|
- name: Download Artifact
|
||||||
|
id: download
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: example-document
|
||||||
|
path: ${{ github.workspace }}/Example.pdf
|
||||||
|
- name: 'Artifact Download Path'
|
||||||
|
run: echo ${{ steps.download.outputs.download-path }}
|
||||||
|
- name: Prepare Release
|
||||||
|
run: echo ${{ github.sha }} > Release.txt
|
||||||
|
- name: Tag Release Commit
|
||||||
|
run: |
|
||||||
|
echo ${{github.event.head_commit.message}} | grep -Po '(?<=Release-As: )v\d+\.\d+\.\d+' > Version.txt
|
||||||
|
echo "==> Tagging for version: $(cat Version.txt)"
|
||||||
|
git config --global credential.helper store
|
||||||
|
echo "https://${USERNAME}:${{secrets.RELEASE_TOKEN}}}@${{github.repositoryUrl}}" > ~/.git-credentials
|
||||||
|
git tag -m "Release" $(cat Version.txt)
|
||||||
|
git push ${{github.repositoryUrl}} $(cat Version.txt)
|
||||||
- name: Create release
|
- name: Create release
|
||||||
id: create-release
|
id: create-release
|
||||||
uses: https://gitea.com/actions/release-action@main
|
uses: https://gitea.com/actions/release-action@main
|
||||||
with:
|
with:
|
||||||
files: |-
|
files: |-
|
||||||
example.pdf
|
Example.pdf
|
||||||
|
Release.txt
|
||||||
|
Version.txt
|
||||||
|
LICENSE
|
||||||
api_key: '${{secrets.RELEASE_TOKEN}}'
|
api_key: '${{secrets.RELEASE_TOKEN}}'
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
name: GitHub Action for checking typst compilation
|
|
||||||
run-name: Performing Typst compilation
|
|
||||||
on: [push]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run-ci-linux:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Check out repository code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Setup Nix
|
|
||||||
uses: cachix/install-nix-action@v27
|
|
||||||
with:
|
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
|
||||||
- name: Run CI
|
|
||||||
run: nix-shell --run ./run-ci.sh
|
|
|
@ -1,12 +1,13 @@
|
||||||
name: release
|
name: Build'n check
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
branches:
|
||||||
- 'v*.*.*'
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
build:
|
||||||
|
name: Check Template and Build example
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
|
@ -15,16 +16,49 @@ jobs:
|
||||||
uses: cachix/install-nix-action@v27
|
uses: cachix/install-nix-action@v27
|
||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
- name: Run CI
|
- name: Stylecheck
|
||||||
run: nix-shell --run ./run-ci.sh
|
run: nix-shell --run "./run-fmt.sh --check src/lib.typ"
|
||||||
|
- id: build
|
||||||
|
name: Build
|
||||||
|
run: |
|
||||||
|
nix-shell --run ./run-ci.sh
|
||||||
|
- name: Upload artifact
|
||||||
|
id: artifact-upload
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: example-document
|
||||||
|
path: ${{ github.workspace }}/example.pdf
|
||||||
|
if-no-files-found: error
|
||||||
|
retention-days: 1
|
||||||
|
- name: Output artifact ID
|
||||||
|
run: echo 'Artifact ID is ${{ steps.artifact-upload.outputs.artifact-id }}'
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v3
|
||||||
- name: Setup go
|
- name: Setup go
|
||||||
uses: https://github.com/actions/setup-go@v4
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: '>=1.20.1'
|
go-version: '>=1.20.1'
|
||||||
- name: Create release
|
- name: Download Artifcat
|
||||||
id: create-release
|
id: download
|
||||||
uses: https://gitea.com/actions/release-action@main
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
files: |-
|
name: example-document
|
||||||
example.pdf
|
path: ${{ github.workspace }}/Example.pdf
|
||||||
api_key: '${{secrets.RELEASE_TOKEN}}'
|
- name: 'Artifact Download Path'
|
||||||
|
run: echo ${{ steps.download.outputs.download-path }}
|
||||||
|
- name: Prepare Release
|
||||||
|
run: echo ${{ github.sha }} > Release.txt
|
||||||
|
- name: Release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
Example.pdf
|
||||||
|
Release.txt
|
||||||
|
LICENSE
|
||||||
|
|
18
LICENSE
18
LICENSE
|
@ -2,8 +2,20 @@ MIT License
|
||||||
|
|
||||||
Copyright (c) 2024 Sven Vogel
|
Copyright (c) 2024 Sven Vogel
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
|
48
run-ci.sh
48
run-ci.sh
|
@ -1,49 +1,3 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
function log() {
|
typst compile template/main.typ --root . --font-path fonts example.pdf
|
||||||
local timestamp=$(date +"%Y-%m-%d %H:%M:%S")
|
|
||||||
echo "$1 at $timestamp: $2"
|
|
||||||
}
|
|
||||||
|
|
||||||
function abort() {
|
|
||||||
log "ERROR" "test case $1 has failed"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
function print-box() {
|
|
||||||
printf "\\n"
|
|
||||||
echo ".----------------------------------------------------------------."
|
|
||||||
printf "| %-62s |\\n" "$1"
|
|
||||||
echo "'----------------------------------------------------------------'"
|
|
||||||
}
|
|
||||||
|
|
||||||
function enter-section() {
|
|
||||||
print-box "$1"
|
|
||||||
|
|
||||||
log "INFO" "running task in section $1: $2"
|
|
||||||
log "INFO" "section output following..."
|
|
||||||
printf "\\n"
|
|
||||||
|
|
||||||
eval "$2"
|
|
||||||
exit_status=$?
|
|
||||||
|
|
||||||
if [ "$3" == "should fail" ]; then
|
|
||||||
log "INFO" "expected to fail..."
|
|
||||||
if [ $exit_status -eq 0 ]; then
|
|
||||||
abort "command: $2 failed in section: $1 with: $exit_status"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
log "INFO" "expected to pass..."
|
|
||||||
if [ ! $exit_status -eq 0 ]; then
|
|
||||||
abort "command: $2 failed in section: $1 with: $exit_status"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf "\\n"
|
|
||||||
log "INFO" "section $1 completed successfully"
|
|
||||||
}
|
|
||||||
|
|
||||||
enter-section "Typstyle checking" "./run-fmt.sh --check src/lib.typ" 0
|
|
||||||
enter-section "Compiling template..." "typst compile template/main.typ --root . --font-path fonts example.pdf"
|
|
||||||
|
|
||||||
log "INFO" "CI completed successfully"
|
|
||||||
|
|
|
@ -9,5 +9,6 @@ pkgs.mkShellNoCC {
|
||||||
python312Packages.pyyaml
|
python312Packages.pyyaml
|
||||||
typst
|
typst
|
||||||
typstyle
|
typstyle
|
||||||
|
ripgrep
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -200,7 +200,9 @@ SOFTWARE.*/
|
||||||
#block(
|
#block(
|
||||||
below: 1.5em,
|
below: 1.5em,
|
||||||
width: 100%,
|
width: 100%,
|
||||||
par(hanging-indent: 1em, align(left)[
|
par(
|
||||||
|
hanging-indent: 1em,
|
||||||
|
align(left)[
|
||||||
#text(weight: "bold", entry.short)
|
#text(weight: "bold", entry.short)
|
||||||
#if hasLong and hasDesc [
|
#if hasLong and hasDesc [
|
||||||
(#text(entry.long))
|
(#text(entry.long))
|
||||||
|
@ -239,7 +241,8 @@ SOFTWARE.*/
|
||||||
)
|
)
|
||||||
.join(", ")
|
.join(", ")
|
||||||
}
|
}
|
||||||
]),
|
],
|
||||||
|
),
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
pagebreak(weak: true)
|
pagebreak(weak: true)
|
||||||
|
|
||||||
let thesis = config.thesis
|
let thesis = config.thesis
|
||||||
let author = config.author
|
|
||||||
|
|
||||||
if text.lang == "de" [
|
if text.lang == "de" [
|
||||||
#heading("Vorabfassung")
|
#heading("Vorabfassung")
|
||||||
|
@ -46,13 +45,9 @@
|
||||||
set par(justify: true)
|
set par(justify: true)
|
||||||
|
|
||||||
if text.lang == "de" [
|
if text.lang == "de" [
|
||||||
handelt es sich _nicht_ um die fertige Fassung. Das Dokument kann Inhaltliche-, Grammatikalische- sowie Format-Fehler enthalten. Das Dokument ist im Rahmen der Aufgabenstellung von Seiten der #author.university nicht zur Bewertung freigegeben und ein anderer Verwendungszweck als eine Vorschau ist nicht gestattet.
|
handelt es sich _nicht_ um die fertige Fassung. Das Dokument kann Inhaltliche-, Grammatikalische- sowie Format-Fehler enthalten. Das Dokument ist im Rahmen der Aufgabenstellung von Seiten der #university.name nicht zur Bewertung freigegeben und ein anderer Verwendungszweck als eine Vorschau ist nicht gestattet.
|
||||||
] else if text.lang == "en" [
|
] else if text.lang == "en" [
|
||||||
is not the final version. The document may contain errors in content, grammar and formatting. The document may not be released for evaluation to #author.university as part of the assignment, and any use other than a preview is not permitted.
|
is not the final version. The document may contain errors in content, grammar and formatting. The document may not be released for evaluation to #university.name as part of the assignment, and any use other than a preview is not permitted.
|
||||||
]
|
]
|
||||||
|
|
||||||
v(1em)
|
|
||||||
h(1em)
|
|
||||||
[#author.name, #datetime.today().display()]
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue