Skip to content

Commit

Permalink
Publish to JSR
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlia committed Apr 16, 2024
1 parent 85473e6 commit ec4fa3c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,31 @@ jobs:
slug: dahlia/logtape
file: .cov.lcov
- run: deno task check

publish:
needs: [test]
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- if: github.ref_type == 'branch'
run: |
jq \
--arg build "$GITHUB_RUN_NUMBER" \
--arg commit "${GITHUB_SHA::8}" \
'.version = .version + "-dev." + $build + "+" + $commit' \
deno.json > deno.json.tmp
mv deno.json.tmp deno.json
- if: github.ref_type == 'tag'
run: |
set -ex
[[ "$(jq -r .version deno.json)" = "$GITHUB_REF_NAME" ]]
- if: github.event_name == 'pull_request'
run: deno publish --dry-run --allow-dirty
- if: github.event_name == 'push'
run: deno publish --allow-dirty
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@hongminhee/logtape",
"name": "@logtape/logtape",
"version": "0.1.0",
"exports": "./logtape/mod.ts",
"imports": {
Expand Down

0 comments on commit ec4fa3c

Please sign in to comment.