* chore: upgrade linguify * chore: update tests * fix: remove deprecated type checks * chore: improve Justfile docs * chore: compile with typst 0.12 and 0.13 in CI * chore: use tytanic for testing * chore: use tytanic in CI * fix: don't use ubuntu-latest * fix: test runner issues * chore: trying to fix CI issues * fix: remove unused font in tests * fix: update references
78 lines
2.3 KiB
YAML
78 lines
2.3 KiB
YAML
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-22.04
|
|
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}" != "${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}"
|