|
| 1 | +env: |
| 2 | + IMPORT_STATEMENT: import "webext-dynamic-content-scripts" |
| 3 | + |
| 4 | +# FILE GENERATED WITH: npx ghat fregante/ghatemplates/esm-lint |
| 5 | +# SOURCE: https://github.com/fregante/ghatemplates |
| 6 | +# OPTIONS: {"exclude":["jobs.Node"]} |
| 7 | + |
| 8 | +name: ESM |
| 9 | +on: |
| 10 | + pull_request: |
| 11 | + branches: |
| 12 | + - '*' |
| 13 | + push: |
| 14 | + branches: |
| 15 | + - master |
| 16 | + - main |
| 17 | +jobs: |
| 18 | + Pack: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + - run: npm install |
| 23 | + - run: npm run build --if-present |
| 24 | + - run: npm pack --dry-run |
| 25 | + - run: npm pack | tail -1 | xargs -n1 tar -xzf |
| 26 | + - uses: actions/upload-artifact@v4 |
| 27 | + with: |
| 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 |
| 35 | + Webpack: |
| 36 | + runs-on: ubuntu-latest |
| 37 | + needs: Pack |
| 38 | + steps: |
| 39 | + - uses: actions/download-artifact@v4 |
| 40 | + - run: npm install --omit=dev ./artifact |
| 41 | + - run: echo "$IMPORT_STATEMENT" > index.js |
| 42 | + - run: webpack --entry ./index.js |
| 43 | + - run: cat dist/main.js |
| 44 | + Parcel: |
| 45 | + runs-on: ubuntu-latest |
| 46 | + needs: Pack |
| 47 | + steps: |
| 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 |
| 54 | + - run: npx parcel@2 build index.js |
| 55 | + - run: cat dist/index.js |
| 56 | + Rollup: |
| 57 | + runs-on: ubuntu-latest |
| 58 | + needs: Pack |
| 59 | + steps: |
| 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 |
| 63 | + - run: npx rollup -p node-resolve index.js |
| 64 | + Vite: |
| 65 | + runs-on: ubuntu-latest |
| 66 | + needs: Pack |
| 67 | + steps: |
| 68 | + - uses: actions/download-artifact@v4 |
| 69 | + - run: npm install --omit=dev ./artifact |
| 70 | + - run: echo '<script type="module">$IMPORT_STATEMENT</script>' > index.html |
| 71 | + - run: npx vite build |
| 72 | + - run: cat dist/assets/* |
| 73 | + esbuild: |
| 74 | + runs-on: ubuntu-latest |
| 75 | + needs: Pack |
| 76 | + steps: |
| 77 | + - uses: actions/download-artifact@v4 |
| 78 | + - run: echo '{}' > package.json |
| 79 | + - run: echo "$IMPORT_STATEMENT" > index.js |
| 80 | + - run: npm install --omit=dev ./artifact |
| 81 | + - run: npx esbuild --bundle index.js |
| 82 | + TypeScript: |
| 83 | + runs-on: ubuntu-latest |
| 84 | + needs: Pack |
| 85 | + steps: |
| 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 |
0 commit comments