-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from DeveloperPaul123/feature/project-infastru…
…cture-updates
- Loading branch information
Showing
17 changed files
with
435 additions
and
46 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Package and push to registry repo | ||
on: | ||
push: | ||
tags: [ '*' ] | ||
|
||
env: | ||
# the repository to which to push the release version | ||
# usually a fork of typst/packages (https://github.com/typst/packages/) | ||
# that you have push privileges to | ||
REGISTRY_REPO: DeveloperPaul123/typst-packages | ||
# the path within that repo where the "<name>/<version>" directory should be put | ||
# for the Typst package registry, keep this as is | ||
PATH_PREFIX: packages/preview | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Probe runner package cache | ||
uses: awalsh128/cache-apt-pkgs-action@v1 | ||
with: | ||
packages: cargo | ||
version: 1.0 | ||
|
||
- name: Install just from crates.io | ||
uses: baptiste0928/cargo-install@v3 | ||
with: | ||
crate: just | ||
|
||
- name: Setup typst | ||
uses: typst-community/setup-typst@v3 | ||
with: | ||
typst-version: latest | ||
|
||
- name: Determine and check package metadata | ||
run: | | ||
. scripts/setup | ||
echo "PKG_NAME=${PKG_PREFIX}" >> "${GITHUB_ENV}" | ||
echo "PKG_VERSION=${VERSION}" >> "${GITHUB_ENV}" | ||
if [[ "${GITHUB_REF_NAME}" != "v${VERSION}" ]]; then | ||
echo "package version ${VERSION} does not match release tag ${GITHUB_REF_NAME}" >&2 | ||
exit 1 | ||
fi | ||
- name: Build package | ||
run: | | ||
just doc | ||
just package out | ||
- name: Checkout package registry | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ env.REGISTRY_REPO }} | ||
token: ${{ secrets.REGISTRY_TOKEN }} | ||
path: typst-packages | ||
|
||
- name: Release package | ||
run: | | ||
mkdir -p "typst-packages/${{ env.PATH_PREFIX }}/$PKG_NAME" | ||
mv "out/${PKG_NAME}/${PKG_VERSION}" "typst-packages/${{ env.PATH_PREFIX }}/${PKG_NAME}" | ||
rmdir "out/${PKG_NAME}" | ||
rmdir out | ||
GIT_USER_NAME="$(git log -1 --pretty=format:'%an')" | ||
GIT_USER_EMAIL="$(git log -1 --pretty=format:'%ae')" | ||
cd typst-packages | ||
git config user.name "${GIT_USER_NAME}" | ||
git config user.email "${GIT_USER_EMAIL}" | ||
git checkout -b "${PKG_NAME}-${PKG_VERSION}" | ||
git add . | ||
git commit -m "${PKG_NAME}:${PKG_VERSION}" | ||
git push --set-upstream origin "${PKG_NAME}-${PKG_VERSION}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Tests | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
tests: | ||
strategy: | ||
matrix: | ||
# add any other Typst versions that your package should support | ||
typst-version: ["0.11"] | ||
# the docs don't need to build with all versions supported by the package; | ||
# the latest one is enough | ||
include: | ||
- typst-version: "0.11" | ||
doc: 1 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Probe runner package cache | ||
uses: awalsh128/cache-apt-pkgs-action@v1 | ||
with: | ||
packages: imagemagick cargo | ||
version: 1.0 | ||
|
||
- name: Install oxipng from crates.io | ||
uses: baptiste0928/cargo-install@v3 | ||
with: | ||
crate: oxipng | ||
|
||
- name: Install just from crates.io | ||
uses: baptiste0928/cargo-install@v3 | ||
with: | ||
crate: just | ||
|
||
- name: Install typst-test from github | ||
uses: baptiste0928/cargo-install@v3 | ||
with: | ||
crate: typst-test | ||
git: https://github.com/tingerrr/typst-test.git | ||
tag: ci-semi-stable | ||
|
||
- name: Setup typst | ||
uses: typst-community/setup-typst@v3 | ||
with: | ||
typst-version: ${{ matrix.typst-version }} | ||
|
||
- name: Install fonts | ||
run: | | ||
sudo apt update | ||
sudo apt-get install fonts-font-awesome fonts-roboto | ||
./scripts/install-fontawesome | ||
- name: Install locally | ||
run: just install | ||
|
||
- name: Run test suite | ||
run: just test | ||
|
||
- name: Archive diffs | ||
uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: diffs | ||
path: | | ||
tests/**/diff/*.png | ||
tests/**/out/*.png | ||
tests/**/ref/*.png | ||
retention-days: 5 | ||
|
||
- name: Build docs | ||
if: ${{ matrix.doc }} | ||
run: just doc | ||
|
||
- name: Upload docs | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: manual | ||
path: docs/manual.pdf |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
tests/*/diff | ||
tests/*/out |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ scripts | |
template/*.pdf | ||
.gitignore | ||
.issuetracker | ||
modern-cv-docs.* | ||
tests/* | ||
docs/* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
root := justfile_directory() | ||
|
||
export TYPST_ROOT := root | ||
|
||
[private] | ||
default: | ||
@just --list --unsorted | ||
|
||
# generate manual | ||
doc: | ||
typst compile docs/manual.typ docs/manual.pdf | ||
|
||
# run test suite | ||
test *args: | ||
typst-test run {{ args }} | ||
|
||
# update test cases | ||
update *args: | ||
typst-test update {{ args }} | ||
|
||
# package the library into the specified destination folder | ||
package target: | ||
./scripts/package "{{target}}" | ||
|
||
# install the library with the "@local" prefix | ||
install: (package "@local") | ||
|
||
# install the library with the "@preview" prefix (for pre-release testing) | ||
install-preview: (package "@preview") | ||
|
||
[private] | ||
remove target: | ||
./scripts/uninstall "{{target}}" | ||
|
||
# uninstalls the library from the "@local" prefix | ||
uninstall: (remove "@local") | ||
|
||
# uninstalls the library from the "@preview" prefix (for pre-release testing) | ||
uninstall-preview: (remove "@preview") | ||
|
||
format: | ||
./scripts/format | ||
|
||
# run ci suite | ||
ci: test doc |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
set -eu | ||
|
||
find . -iname "*.typ" | xargs typstyle -i |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
set -eu | ||
|
||
wget -O ~/fontawesome.zip https://use.fontawesome.com/releases/v6.6.0/fontawesome-free-6.6.0-desktop.zip | ||
mkdir -p ~/fontawesome-fonts | ||
unzip ~/fontawesome.zip -d ~/fontawesome-fonts | ||
mkdir -p ~/.fonts | ||
find ~/fontawesome-fonts -type f -name "*.otf" -exec cp {} ~/.fonts \; | ||
rm ~/fontawesome.zip | ||
rm -rf ~/fontawesome-fonts | ||
fc-cache -f -v |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.