-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
756 changed files
with
45,218 additions
and
23,920 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -30,7 +30,7 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@1.77.0 | ||
- uses: dtolnay/rust-toolchain@1.81.0 | ||
- uses: Swatinem/rust-cache@v2 | ||
- run: cargo test --workspace --no-run | ||
- run: cargo test --workspace --no-fail-fast | ||
|
@@ -40,7 +40,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@1.77.0 | ||
- uses: dtolnay/rust-toolchain@1.81.0 | ||
with: | ||
components: clippy, rustfmt | ||
- uses: Swatinem/rust-cache@v2 | ||
|
@@ -49,11 +49,11 @@ jobs: | |
- run: cargo doc --workspace --no-deps | ||
|
||
min-version: | ||
name: Check mininum Rust version | ||
name: Check minimum Rust version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@1.74.0 | ||
- uses: dtolnay/rust-toolchain@1.77.0 | ||
- uses: Swatinem/rust-cache@v2 | ||
- run: cargo check --workspace | ||
|
||
|
@@ -64,7 +64,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: nightly-2023-09-13 | ||
toolchain: nightly-2024-06-01 | ||
- uses: Swatinem/rust-cache@v2 | ||
- run: cargo install --locked [email protected] | ||
- run: cd tests/fuzz && cargo fuzz build --dev |
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 |
---|---|---|
|
@@ -2,29 +2,49 @@ name: Build and Publish Docker Image | |
|
||
on: | ||
release: | ||
types: [created] | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
PLATFORMS: linux/amd64,linux/arm64 | ||
|
||
jobs: | ||
build-and-publish: | ||
build: | ||
name: Build Images | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: | ||
- linux/amd64 | ||
- linux/arm64 | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Prepare | ||
run: | | ||
platform=${{ matrix.platform }} | ||
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV | ||
echo "IMAGE_NAME=${REGISTRY}/${GITHUB_REPOSITORY@L}" >> $GITHUB_ENV | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get current date | ||
run: echo "TYPST_BUILD_DATE=\"$(date -u +'%Y-%m-%dT%H:%M:%SZ')\" >> $GITHUB_ENV" | ||
|
||
- name: Setup Docker buildx | ||
uses: docker/[email protected] | ||
with: | ||
platforms: ${{ env.PLATFORMS }} | ||
platforms: ${{ matrix.platform }} | ||
|
||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/[email protected] | ||
with: | ||
images: ${{ env.IMAGE_NAME }} | ||
|
||
- name: Log into registry ${{ env.REGISTRY }} | ||
uses: docker/[email protected] | ||
|
@@ -33,19 +53,76 @@ jobs: | |
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/[email protected] | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
id: build-and-push | ||
- name: Build Docker image | ||
id: build | ||
uses: docker/[email protected] | ||
with: | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: ${{ env.PLATFORMS }} | ||
platforms: ${{ matrix.platform }} | ||
outputs: type=image,name=${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
build-args: | | ||
REVISION=${{ github.sha }} | ||
CREATED=${{ env.TYPST_BUILD_DATE }} | ||
- name: Export digest | ||
run: | | ||
mkdir -p /tmp/digests | ||
digest="${{ steps.build.outputs.digest }}" | ||
touch "/tmp/digests/${digest#sha256:}" | ||
- name: Upload digest | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: digests-${{ env.PLATFORM_PAIR }} | ||
path: /tmp/digests/* | ||
if-no-files-found: error | ||
retention-days: 1 | ||
|
||
merge: | ||
name: Merge and Publish | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Prepare | ||
run: | | ||
echo "IMAGE_NAME=${REGISTRY}/${GITHUB_REPOSITORY@L}" >> $GITHUB_ENV | ||
- name: Download digests | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: /tmp/digests | ||
pattern: digests-* | ||
merge-multiple: true | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.IMAGE_NAME }} | ||
|
||
- name: Log into registry ${{ env.REGISTRY }} | ||
uses: docker/[email protected] | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create manifest list and push | ||
working-directory: /tmp/digests | ||
run: | | ||
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | ||
$(printf '${{ env.IMAGE_NAME }}@sha256:%s ' *) | ||
- name: Inspect image | ||
run: | | ||
docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.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,81 @@ | ||
name: Move to Typst Forum | ||
on: | ||
issues: | ||
types: | ||
- labeled | ||
jobs: | ||
add-comment: | ||
if: github.event.label.name == 'to-forum' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
steps: | ||
- name: Call Discourse API to create forum post | ||
env: | ||
ISSUE_BODY: ${{ github.event.issue.body }} | ||
ISSUE_TITLE: ${{ github.event.issue.title }} | ||
ISSUE_NUMBER: ${{ github.event.issue.number }} | ||
ISSUE_URL: ${{ github.event.issue.html_url }} | ||
ISSUE_USER_LOGIN: ${{ github.event.issue.user.login }} | ||
REPOSITORY_OWNER: ${{ github.repository_owner }} | ||
run: | | ||
read -d '' RAW << END_OF_BODY | ||
This topic was moved from GitHub issue ${ISSUE_NUMBER}. Please continue the conversation here. | ||
Here is the original issue: | ||
[quote="${ISSUE_USER_LOGIN}"] | ||
${ISSUE_BODY} | ||
[/quote] | ||
Browse the previous discussion at ${ISSUE_URL} | ||
END_OF_BODY | ||
TITLE_JSON=$(jq -n --arg title "[#${ISSUE_NUMBER}] ${ISSUE_TITLE}" '$title') | ||
RAW_JSON=$(jq -n --arg raw "$RAW" '$raw') | ||
EXTERNAL_ID_JSON=$(jq -n --arg external_id "gh-${REPOSITORY_OWNER}-typst-${ISSUE_NUMBER}" '$external_id') | ||
RESPONSE=$(curl -X POST "https://forum.typst.app/posts.json" \ | ||
--fail-with-body \ | ||
-H "Api-Key: ${{ secrets.DISCOURSE_TOKEN }}" \ | ||
-H "Content-Type: application/json" \ | ||
-d "{ | ||
\"title\": $TITLE_JSON, | ||
\"category\": 4, | ||
\"external_id\": $EXTERNAL_ID_JSON, | ||
\"raw\": $RAW_JSON | ||
}") | ||
# Check if response contains errors | ||
if [ $(jq -n --argjson response "$RESPONSE" '$response.errors | length') -gt 0 ]; then | ||
# Join the errors with commas | ||
ERRORS=$(jq -n --argjson response "$RESPONSE" '$response.errors | join(", ")') | ||
echo "DISCOURSE_ERROR=$ERRORS" >> $GITHUB_ENV | ||
exit 1 | ||
fi | ||
# Check if the response returned a non-200 status code | ||
if [ $? -ne 0 ]; then | ||
echo "DISCOURSE_ERROR=Failed to call the Discourse API" >> $GITHUB_ENV | ||
exit 1 | ||
fi | ||
THREAD_ID="$(jq -n --argjson response "$RESPONSE" '$response.topic_id')" | ||
if [ "$THREAD_ID" = 'null' ]; then | ||
echo "DISCOURSE_ERROR=Failed to retrieve new thread ID" >> $GITHUB_ENV | ||
exit 1 | ||
fi | ||
echo "THREAD_ID=$THREAD_ID" >> $GITHUB_ENV | ||
- name: Add a comment if the workflow failed | ||
if: failure() | ||
run: | | ||
gh issue comment ${{ github.event.issue.number }} --body "Failed to move this issue to the Typst Forum. This is the error that the API call returned: $DISCOURSE_ERROR" | ||
- name: Add comment and close as not planned | ||
run: | | ||
gh issue close "$NUMBER" --reason "not planned" --comment "$BODY" | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GH_REPO: ${{ github.repository }} | ||
NUMBER: ${{ github.event.issue.number }} | ||
BODY: > | ||
We moved this issue to the Typst Forum. Please continue the discussion there: https://forum.typst.app/t/${{ env.THREAD_ID }} |
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,42 @@ | ||
cff-version: 1.2.0 | ||
title: Typst | ||
message: >- | ||
If you use this software, please cite it using the | ||
metadata from this file. | ||
type: software | ||
authors: | ||
- given-names: Laurenz | ||
family-names: Mädje | ||
email: [email protected] | ||
- given-names: Martin | ||
family-names: Haug | ||
email: [email protected] | ||
- name: The Typst Project Developers | ||
references: | ||
- title: A Programmable Markup Language for Typesetting | ||
authors: | ||
- family-names: Mädje | ||
given-names: Laurenz | ||
year: 2022 | ||
type: thesis | ||
thesis-type: Master's thesis | ||
url: https://laurmaedje.github.io/programmable-markup-language-for-typesetting.pdf | ||
institution: | ||
name: Technische Universität Berlin | ||
- title: Fast typesetting with incremental compilation | ||
authors: | ||
- family-names: Haug | ||
given-names: Martin | ||
year: 2022 | ||
type: thesis | ||
thesis-type: Master's thesis | ||
doi: 10.13140/RG.2.2.15606.88642 | ||
url: https://doi.org/10.13140/RG.2.2.15606.88642 | ||
institution: | ||
name: Technische Universität Berlin | ||
repository-code: 'https://github.com/typst/typst' | ||
url: 'https://typst.app/' | ||
keywords: | ||
- typesetting | ||
- markup language | ||
license: Apache-2.0 |
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
Oops, something went wrong.