1
1
env :
2
- IMPORT_TEXT : import * as pageDetect from
3
- NPM_MODULE_NAME : github-url-detection
2
+ IMPORT_STATEMENT : import * as pageDetect from "github-url-detection"
4
3
5
4
# FILE GENERATED WITH: npx ghat fregante/ghatemplates/esm-lint
6
5
# SOURCE: https://github.com/fregante/ghatemplates
@@ -19,77 +18,87 @@ jobs:
19
18
Pack :
20
19
runs-on : ubuntu-latest
21
20
steps :
22
- - uses : actions/checkout@v3
21
+ - uses : actions/checkout@v4
23
22
- run : npm install
24
23
- run : npm run build --if-present
25
24
- run : npm pack --dry-run
26
25
- run : npm pack | tail -1 | xargs -n1 tar -xzf
27
- - uses : actions/upload-artifact@v3
26
+ - uses : actions/upload-artifact@v4
28
27
with :
29
28
path : package
29
+ Publint :
30
+ runs-on : ubuntu-latest
31
+ needs : Pack
32
+ steps :
33
+ - uses : actions/download-artifact@v4
34
+ - run : npx publint ./artifact
30
35
Webpack :
31
36
runs-on : ubuntu-latest
32
37
needs : Pack
33
38
steps :
34
- - uses : actions/download-artifact@v3
35
- - run : npm install ./artifact
36
- - run : echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}' " > index.js
39
+ - uses : actions/download-artifact@v4
40
+ - run : npm install --omit=dev ./artifact
41
+ - run : echo "$IMPORT_STATEMENT " > index.js
37
42
- run : webpack --entry ./index.js
38
43
- run : cat dist/main.js
39
44
Parcel :
40
45
runs-on : ubuntu-latest
41
46
needs : Pack
42
47
steps :
43
- - uses : actions/download-artifact@v3
44
- - run : npm install ./artifact
45
- - run : echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.js
48
+ - uses : actions/download-artifact@v4
49
+ - run : npm install --omit=dev ./artifact
50
+ - run : echo "$IMPORT_STATEMENT" > index.js
51
+ - run : >
52
+ echo '{"@parcel/resolver-default": {"packageExports": true}}' >
53
+ package.json
46
54
- run : npx parcel@2 build index.js
47
55
- run : cat dist/index.js
48
56
Rollup :
49
57
runs-on : ubuntu-latest
50
58
needs : Pack
51
59
steps :
52
- - uses : actions/download-artifact@v3
53
- - run : npm install ./artifact rollup@2 @rollup/plugin-node-resolve
54
- - run : echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}' " > index.js
60
+ - uses : actions/download-artifact@v4
61
+ - run : npm install --omit=dev ./artifact rollup@2 @rollup/plugin-node-resolve
62
+ - run : echo "$IMPORT_STATEMENT " > index.js
55
63
- run : npx rollup -p node-resolve index.js
56
64
Vite :
57
65
runs-on : ubuntu-latest
58
66
needs : Pack
59
67
steps :
60
- - uses : actions/download-artifact@v3
61
- - run : npm install ./artifact
62
- - run : >-
63
- echo '<script type="module">${{ env.IMPORT_TEXT }} "${{
64
- env.NPM_MODULE_NAME }}"</script>' > index.html
68
+ - uses : actions/download-artifact@v4
69
+ - run : npm install --omit=dev ./artifact
70
+ - run : echo '<script type="module">$IMPORT_STATEMENT</script>' > index.html
65
71
- run : npx vite build
66
72
- run : cat dist/assets/*
67
73
esbuild :
68
74
runs-on : ubuntu-latest
69
75
needs : Pack
70
76
steps :
71
- - uses : actions/download-artifact@v3
77
+ - uses : actions/download-artifact@v4
72
78
- run : echo '{}' > package.json
73
- - run : echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}' " > index.js
74
- - run : npm install ./artifact
79
+ - run : echo "$IMPORT_STATEMENT " > index.js
80
+ - run : npm install --omit=dev ./artifact
75
81
- run : npx esbuild --bundle index.js
76
82
TypeScript :
77
83
runs-on : ubuntu-latest
78
84
needs : Pack
79
85
steps :
80
- - uses : actions/download-artifact@v3
81
- - run : npm install ./artifact
82
- - run : echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.ts
83
- - run : tsc index.ts
84
- - run : cat index.js
86
+ - uses : actions/download-artifact@v4
87
+ - run : npm install --omit=dev ./artifact @sindresorhus/tsconfig
88
+ - run : echo "$IMPORT_STATEMENT" > index.ts
89
+ - run : >
90
+ echo '{"extends":"@sindresorhus/tsconfig","files":["index.ts"]}' >
91
+ tsconfig.json
92
+ - run : npx --package typescript -- tsc
93
+ - run : cat distribution/index.js
85
94
Node :
86
95
runs-on : ubuntu-latest
87
96
needs : Pack
88
97
steps :
89
- - uses : actions/download-artifact@v3
90
- - uses : actions/setup-node@v3
98
+ - uses : actions/download-artifact@v4
99
+ - uses : actions/setup-node@v4
91
100
with :
92
- node-version : 14.x
93
- - run : echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}' " > index.mjs
94
- - run : npm install ./artifact
101
+ node-version-file : artifact/package.json
102
+ - run : echo "$IMPORT_STATEMENT " > index.mjs
103
+ - run : npm install --omit=dev ./artifact
95
104
- run : node index.mjs
0 commit comments