-
-
Notifications
You must be signed in to change notification settings - Fork 12
87 lines (85 loc) · 2.48 KB
/
esm-lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
env:
IMPORT_TEXT: import OptionsSync from
NPM_MODULE_NAME: webext-options-sync
# FILE GENERATED WITH: npx ghat fregante/ghatemplates/esm-lint
# SOURCE: https://github.com/fregante/ghatemplates
# OPTIONS: {"exclude":["jobs.Rollup"]}
name: ESM
on:
pull_request:
branches:
- '*'
push:
branches:
- master
- main
jobs:
Pack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm install
- run: npm run build --if-present
- run: npm pack --dry-run
- run: npm pack | tail -1 | xargs -n1 tar -xzf
- uses: actions/upload-artifact@v3
with:
path: package
Webpack:
runs-on: ubuntu-latest
needs: Pack
steps:
- uses: actions/download-artifact@v3
- run: npm install ./artifact
- run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.js
- run: webpack --entry ./index.js
- run: cat dist/main.js
Parcel:
runs-on: ubuntu-latest
needs: Pack
steps:
- uses: actions/download-artifact@v3
- run: npm install ./artifact
- run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.js
- run: npx parcel@2 build index.js
- run: cat dist/index.js
Vite:
runs-on: ubuntu-latest
needs: Pack
steps:
- uses: actions/download-artifact@v3
- run: npm install ./artifact
- run: >-
echo '<script type="module">${{ env.IMPORT_TEXT }} "${{
env.NPM_MODULE_NAME }}"</script>' > index.html
- run: npx vite build
- run: cat dist/assets/*
esbuild:
runs-on: ubuntu-latest
needs: Pack
steps:
- uses: actions/download-artifact@v3
- run: echo '{}' > package.json
- run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.js
- run: npm install ./artifact
- run: npx esbuild --bundle index.js
TypeScript:
runs-on: ubuntu-latest
needs: Pack
steps:
- uses: actions/download-artifact@v3
- run: npm install ./artifact && npm install @types/estree
- run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.ts
- run: tsc index.ts
- run: cat index.js
Node:
runs-on: ubuntu-latest
needs: Pack
steps:
- uses: actions/download-artifact@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.mjs
- run: npm install ./artifact
- run: node index.mjs