generated from unplugin/unplugin-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add GitHub workflow for publishing package
This commit introduces a new GitHub workflow named 'jsr'. This workflow is triggered on push events for tags and on workflow dispatch. It sets up the environment with the latest version of 'bun', installs dependencies, fetches the version from the tag, updates the version in package.json and jsr.json, and finally publishes the package if the ref is a version tag.
- Loading branch information
Showing
3 changed files
with
37 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: jsr | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: oven-sh/setup-bun@v1 | ||
with: | ||
bun-version: latest | ||
- run: bun i --frozen-lockfile | ||
- id: get_version | ||
name: Get version | ||
uses: jannemattila/get-version-from-tag@v3 | ||
- name: jsr.json version to packge.json verion | ||
run: | | ||
jq --arg new_version "${{ steps.get_version.outputs.version }}" '.version = $new_version' package.json > package.tmp.json && mv package.tmp.json package.json | ||
jq --arg new_version "${{ steps.get_version.outputs.version }}" '.version = $new_version' jsr.json > jsr.tmp.json && mv jsr.tmp.json jsr.json | ||
working-directory: packages/unplugin-typia | ||
- name: Publish | ||
if: github.ref == 'refs/tags/v*' | ||
run: bun run publish | ||
working-directory: packages/unplugin-typia |
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