Skip to content

Commit

Permalink
Merge pull request #9: add CI
Browse files Browse the repository at this point in the history
Credit: YDX-2147483647
  • Loading branch information
Leedehai authored Sep 8, 2023
2 parents 542a68b + fb92169 commit 5988611
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 13 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on:
push:
paths:
- '*.typ'
pull_request:
paths:
- '*.typ'
workflow_dispatch:

jobs:
compile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: yusancky/setup-typst@v2
with:
version: latest
- name: Compile
run: |
typst compile physica-manual.typ
typst compile demo.typ
- uses: actions/upload-artifact@v3
with:
name: PDF
path: '*.pdf'
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 🚀 Release

on:
push:
tags:
- "v*.*.*"

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: yusancky/setup-typst@v2
with:
version: latest
- name: Compile the manual
run: typst compile physica-manual.typ
- name: Release
id: release
uses: softprops/action-gh-release@v1
with:
name: Physica ${{ github.ref_name }}
files: physica-manual.pdf
fail_on_unmatched_files: true
- name: Generate the job summary
run: echo '🎉 [Release for ${{ github.ref_name }}](${{ steps.release.outputs.url }}) is ready.' >> $GITHUB_STEP_SUMMARY
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# The physica module (for physics)

Current semantic version: `0.7`. [Manual](https://github.com/Leedehai/typst-physics/blob/master/physica-manual.pdf).
[![CI](https://github.com/Leedehai/typst-physics/actions/workflows/ci.yml/badge.svg)](https://github.com/Leedehai/typst-physics/actions/workflows/ci.yml)
[![Latest release date](https://img.shields.io/github/release-date/Leedehai/typst-physics)][latest-release]

Current semantic version: `0.7`. [Manual][latest-manual].

Available at [https://typst.app/docs/packages/](https://typst.app/docs/packages/).

Expand All @@ -24,7 +27,7 @@ everybody", this package was renamed from `physics` to `physica`.

## A quick look

See the [manual](https://github.com/Leedehai/typst-physics/blob/master/physica-manual.pdf) for more details.
See the [manual][latest-manual] for more details.

![demo](https://user-images.githubusercontent.com/18319900/236073825-e91b4601-7e92-490b-a7e4-e9e405a2147b.png)

Expand All @@ -42,25 +45,25 @@ $op("curl")(op("grad") f) = curl (grad f)$

### Without `typst` package management

* To use the `physics` package, simply insert `#import "physics.typ": *` at the
* To use the `physica` package, simply insert `#import "physica.typ": *` at the
beginning of your document.
* To reduce the possibility of name collisions, you may want to import the
package under name scope `physics`:
package under name scope `physica`:
```
#import "physics.typ"
#import "physica.typ"
$op("curl")(op("grad") f) = physics.curl (physics.grad f)$
$op("curl")(op("grad") f) = physica.curl (physica.grad f)$
```
* You may also import names specifically:
```
#import "physics.typ": curl, grad
#import "physica.typ": curl, grad
$op("curl")(op("grad") f) = curl (grad f)$
```

## Manual

See the manual [physics-manual.pdf](https://github.com/Leedehai/typst-physics/blob/master/physica-manual.pdf) for a more comprehensive coverage, a PDF file
See the manual [physica-manual.pdf][latest-manual] for a more comprehensive coverage, a PDF file
generated directly with the [Typst](https://typst.app) binary.

CLI Version:
Expand All @@ -73,7 +76,7 @@ typst 0.6.0 (2dfd44fe)
To regenerate the manual, use command

```sh
typst watch physics-manual.typ
typst watch physica-manual.typ
```

## Contribution
Expand All @@ -85,10 +88,13 @@ request. If it is large, the best first step is creating an issue and let us
explore the design together. Some features might warrant a package on its own.

* Testing: currently testing is done by closely inspecting the generated
[physics-manual.pdf](physics-manual.pdf). This does not scale well. I plan to add programmatic
[physica-manual.pdf][latest-manual]. This does not scale well. I plan to add programmatic
testing by comparing rendered pictures with golden images.

## License

* Code: the [MIT License](LICENSE.txt).
* Docs: the [Creative Commons BY-ND 4.0 license](https://creativecommons.org/licenses/by-nd/4.0/).

[latest-release]: https://github.com/Leedehai/typst-physics/releases/latest "The latest release"
[latest-manual]: https://github.com/Leedehai/typst-physics/releases/latest/download/physica-manual.pdf "Download the latest manual"
4 changes: 2 additions & 2 deletions demo.typ
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2023 Leedehai
// Use of this code is governed by a MIT license in the LICENSE.txt file.
// For a manual on this package, see physics-manual.pdf.
// For a manual on this package, see physica-manual.pdf.

#import "physics.typ": *
#import "physica.typ": *

$
curl vb(E) = - pdv(vb(B), t),
Expand Down
Binary file removed physica-manual.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion physica.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2023 Leedehai
// Use of this code is governed by a MIT license in the LICENSE.txt file.
// Current version: 0.7.5. Please see physics-manual.pdf for user docs.
// Current version: 0.7.5. Please see physica-manual.pdf for user docs.

// Returns whether a Content object holds an integer. The caller is responsible
// for ensuring the input argument is a Content object.
Expand Down

0 comments on commit 5988611

Please sign in to comment.