Skip to content

docs: Update publishing-packages.md #1170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions frontend/docs/publishing-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ from GitHub Actions. To do this, create a workflow file in your repository, for
example at `.github/workflows/publish.yml`. In this workflow file, you can
create a job that publishes your package using the `jsr publish` command.

Tip: to avoid running the workflow on every commit, restrict it to run only when
the file that contains your package version changes (`deno.json`, `deno.jsonc`
or `jsr.json`):

```yaml
# .github/workflows/publish.yml

Expand All @@ -332,6 +336,10 @@ on:
push:
branches:
- main
paths:
- "deno.json"
- "deno.jsonc"
- "jsr.json"

jobs:
publish:
Expand All @@ -344,11 +352,12 @@ jobs:
- run: npx jsr publish
```
This workflow will run every time you push to the `main` branch of your
repository. It will publish your package to JSR, and will automatically use the
correct version number based on the version in your `jsr.json`/`deno.json(c)`
file. `jsr publish` will not attempt to publish if the version specified in your
`jsr.json`/`deno.json(c)` file is already published to JSR.
This workflow will run only when you push to the `main` branch **and** one of
`deno.json`, `deno.jsonc` or `jsr.json` is changed. It will publish your package
to JSR, and will automatically use the correct version number based on the
version in your `jsr.json`/`deno.json(c)` file. `jsr publish` will not attempt
to publish if the version specified in your `jsr.json`/`deno.json(c)` file is
already published to JSR.

## Filtering files

Expand Down
Loading