Skip to content

edit: fix typo in typst.toml #9

edit: fix typo in typst.toml

edit: fix typo in typst.toml #9

Workflow file for this run

name: "Publish to Typst package"
on:
push:
branches: [main]
tags: "*.*.*"
env:
GIT_USER_EMAIL: [email protected]
GIT_USER_NAME: HPDell
PACKAGE_NAME: calendar
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Typst Build
uses: typst-community/setup-typst@v3
- name: Install toml-cli
run: pip install toml-cli
- name: Copy to preview packages
run: |
export PKG_VERSION=`toml get --toml-path typst.toml "package.version"`
export PKG_PREVIEW_HOME="$HOME/.cache/typst/packages/preview/${{ env.PACKAGE_NAME }}/$PKG_VERSION/"
mkdir -p $PKG_PREVIEW_HOME
rsync -avP ./ $PKG_PREVIEW_HOME
- name: Test build example
run: typst compile example.typ
publish:
needs: [build]
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Clone packages repo
run: git clone https://hpdell:${{ secrets.GH_TOKEN }}@github.com/HPDell/typst-packages.git packages
- name: Create branch and directory
working-directory: packages/packages/preview
run: |
git switch -c feat/${{ env.PACKAGE_NAME }}
mkdir -p ${{ env.PACKAGE_NAME }}/${{ github.ref_name }}
- name: Copy files
run: |
cp -r -v \
util \
*.typ \
README.md \
example.png \
LICENSE \
typst.toml \
packages/packages/preview/${{ env.PACKAGE_NAME }}/${{ github.ref_name }}/
- name: Commit and squash
working-directory: packages
run: |
git config --global user.email "${{ env.GIT_USER_EMAIL }}"
git config --global user.name "${{ env.GIT_USER_NAME }}"
git add -A
git commit -m "${{ env.PACKAGE_NAME }}:${{ github.ref_name }}"
git switch main
git merge feat/${{ env.PACKAGE_NAME }}
git branch -D feat/${{ env.PACKAGE_NAME }}
git push origin main