Skip to content

Commit

Permalink
chore: publish to JSR (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
iuioiua authored Apr 24, 2024
1 parent b1dfdf3 commit 816b5c5
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 22 deletions.
24 changes: 8 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ jobs:
RUST_BACKTRACE: full
RUSTFLAGS: -D warnings

permissions:
contents: read
id-token: write

steps:
- name: Clone repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -63,19 +67,7 @@ jobs:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cargo publish -p deno_emit
- name: Get tag version
if: contains(matrix.os, 'ubuntu') && startsWith(github.ref, 'refs/tags/')
id: get_tag_version
run: echo TAG_VERSION=${GITHUB_REF/refs\/tags\//} >> "$GITHUB_OUTPUT"

- name: Publish deno.land/x
uses: denoland/publish-folder@82ce065074e7174baf444332c4b7c40869a4909a
if: contains(matrix.os, 'ubuntu') && startsWith(github.ref, 'refs/tags/')
with:
folder: js
branch: deno_registry
tag: deno/${{ steps.get_tag_version.outputs.TAG_VERSION }}
token: ${{ secrets.DENOBOT_PAT }}
git-user-name: denobot
git-user-email: [email protected]
- name: Publish to JSR
if: contains(matrix.os, 'ubuntu')
run: cd js && deno run -A jsr:@david/[email protected]
5 changes: 4 additions & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
"testdata",
"target",
"tests/__snapshots__"
]
],
"imports": {
"@std/path": "jsr:@std/path@^0.223.0"
}
}
6 changes: 1 addition & 5 deletions js/_utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
isAbsolute,
resolve,
toFileUrl,
} from "https://deno.land/[email protected]/path/mod.ts";
import { isAbsolute, resolve, toFileUrl } from "@std/path";

/**
* Resolves a location to its canonical URL object.
Expand Down
13 changes: 13 additions & 0 deletions js/deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "@deno/emit",
"version": "0.0.0",
"exports": "./mod.ts",
"publish": {
"exclude": [
"!**"
]
},
"imports": {
"@std/path": "jsr:@std/path@^0.223.0"
}
}

0 comments on commit 816b5c5

Please sign in to comment.