File tree Expand file tree Collapse file tree 6 files changed +307
-2
lines changed Expand file tree Collapse file tree 6 files changed +307
-2
lines changed Original file line number Diff line number Diff line change 4
4
push :
5
5
pull_request :
6
6
7
+ env :
8
+ DENO_VERSION : 1.x
9
+ NODE_VERSION : 20.x
10
+
7
11
permissions :
8
12
contents : read
9
13
pull-requests : write
14
18
steps :
15
19
- uses : actions/checkout@v4
16
20
- uses : denoland/setup-deno@v1
21
+ with :
22
+ deno-version : ${{ env.DENO_VERSION }}
17
23
- run : deno lint
18
24
- name : Test
19
25
run : |
35
41
steps :
36
42
- uses : actions/checkout@v4
37
43
- uses : denoland/setup-deno@v1
44
+ with :
45
+ deno-version : ${{ env.DENO_VERSION }}
38
46
- run : deno publish --dry-run
39
47
48
+ npm-publish-dry-run :
49
+ runs-on : ubuntu-latest
50
+ steps :
51
+ - uses : actions/checkout@v4
52
+ with :
53
+ fetch-depth : 0
54
+ - uses : denoland/setup-deno@v1
55
+ with :
56
+ deno-version : ${{ env.DENO_VERSION }}
57
+ - uses : oven-sh/setup-bun@v1
58
+ with :
59
+ bun-version : latest
60
+ - uses : actions/setup-node@v4
61
+ with :
62
+ node-version : ${{ env.NODE_VERSION }}
63
+ registry-url : " https://registry.npmjs.org"
64
+ - run : deno task build-npm
65
+ - run : |
66
+ cd npm
67
+ npm publish --dry-run
40
68
41
69
action-timeline :
42
70
needs :
Original file line number Diff line number Diff line change
1
+ name : npm
2
+
3
+ env :
4
+ DENO_VERSION : 1.x
5
+ NODE_VERSION : 20.x
6
+
7
+ on :
8
+ push :
9
+ tags :
10
+ - " *"
11
+
12
+ jobs :
13
+ publish :
14
+ runs-on : ubuntu-latest
15
+ steps :
16
+ - uses : actions/checkout@v4
17
+ with :
18
+ fetch-depth : 0
19
+ - uses : denoland/setup-deno@v1
20
+ - uses : oven-sh/setup-bun@v1
21
+ with :
22
+ bun-version : latest
23
+ - uses : actions/setup-node@v4
24
+ with :
25
+ node-version : ${{ env.NODE_VERSION }}
26
+ registry-url : " https://registry.npmjs.org"
27
+ - name : Build
28
+ run : deno task build-npm
29
+ - name : Publish
30
+ run : |
31
+ cd npm
32
+ npm publish
33
+ env :
34
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change 2
2
/node_modules
3
3
/types
4
4
/coverage
5
+ /npm
Original file line number Diff line number Diff line change 8
8
"imports" : {
9
9
"type-fest" : " npm:type-fest@4.15.0" ,
10
10
"assert" : " jsr:@std/assert@0.222.1" ,
11
- "type-testing" : " jsr:@std/testing@0.222.1/types"
11
+ "type-testing" : " jsr:@std/testing@0.222.1/types" ,
12
+ "@deno/dnt" : " jsr:@deno/dnt@^0.41.1"
12
13
},
13
14
"tasks" : {
14
15
"dev" : " deno run --watch ./src/index.ts" ,
15
16
"check" : " deno check ./**/*.ts" ,
16
17
"test" : " deno test -A --parallel --doc" ,
17
18
"test:coverage" : " deno task test --coverage=coverage" ,
18
19
"coverage:show" : " deno coverage ./coverage" ,
19
- "coverage:lco" : " deno coverage --lcov ./coverage > ./coverage/lcov.info"
20
+ "coverage:lco" : " deno coverage --lcov ./coverage > ./coverage/lcov.info" ,
21
+ "build-npm" : " deno run -A scripts/build_npm.ts $(git describe --tags --always --dirty)"
20
22
},
21
23
"fmt" : {
22
24
"exclude" : [
Original file line number Diff line number Diff line change
1
+ import { build , emptyDir } from "@deno/dnt" ;
2
+
3
+ const name = "str-fns" ;
4
+ const version = Deno . args [ 0 ] ;
5
+ if ( ! version ) {
6
+ throw new Error ( "No version argument is specified" ) ;
7
+ }
8
+ console . log ( "*" . repeat ( 80 ) ) ;
9
+ console . log ( `${ name } ${ version } ` ) ;
10
+ console . log ( "*" . repeat ( 80 ) ) ;
11
+
12
+ await emptyDir ( "./npm" ) ;
13
+
14
+ await build ( {
15
+ typeCheck : false ,
16
+ test : false ,
17
+ entryPoints : [ "src/index.ts" ] ,
18
+ outDir : "./npm" ,
19
+ shims : {
20
+ deno : "dev" ,
21
+ } ,
22
+ packageManager : "bun" ,
23
+ package : {
24
+ name,
25
+ version,
26
+ author : "@ryoppippi" ,
27
+ license : "MIT" ,
28
+ repository : "ryoppippi/str-fns" ,
29
+ } ,
30
+ } ) ;
31
+
32
+ // post build steps
33
+ Deno . copyFileSync ( "LICENSE" , "npm/LICENSE" ) ;
34
+ Deno . copyFileSync ( "README.md" , "npm/README.md" ) ;
You can’t perform that action at this time.
0 commit comments