5.1.1 #125
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env: | |
IMPORT_TEXT: import React from | |
NPM_MODULE_NAME: dom-chef | |
# FILE GENERATED WITH: npx ghat fregante/ghatemplates/esm-lint | |
# SOURCE: https://github.com/fregante/ghatemplates | |
name: ESM | |
on: | |
pull_request: | |
branches: | |
- '*' | |
push: | |
branches: | |
- master | |
- main | |
jobs: | |
Pack: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- 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@v2 | |
with: | |
path: package | |
Webpack: | |
runs-on: ubuntu-latest | |
needs: Pack | |
steps: | |
- uses: actions/download-artifact@v2 | |
- 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@v2 | |
- 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 | |
Rollup: | |
runs-on: ubuntu-latest | |
needs: Pack | |
steps: | |
- uses: actions/download-artifact@v2 | |
- run: npm install ./artifact rollup@2 @rollup/plugin-node-resolve | |
- run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.js | |
- run: npx rollup -p node-resolve index.js | |
Snowpack: | |
runs-on: ubuntu-latest | |
needs: Pack | |
steps: | |
- uses: actions/download-artifact@v2 | |
- run: echo '{}' > package.json | |
- run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.js | |
- run: npm install ./artifact | |
- run: npx snowpack@2 build | |
- run: cat build/web_modules/$NPM_MODULE_NAME.js | |
TypeScript: | |
runs-on: ubuntu-latest | |
needs: Pack | |
steps: | |
- uses: actions/download-artifact@v2 | |
- run: npm install ./artifact | |
- 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@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 14.x | |
- run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.mjs | |
- run: npm install ./artifact | |
- run: node index.mjs |