diff --git a/.github/workflows/extension-build.js.yml b/.github/workflows/extension-build.js.yml new file mode 100644 index 0000000..67d15d9 --- /dev/null +++ b/.github/workflows/extension-build.js.yml @@ -0,0 +1,36 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [15.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: yarn + - run: npm run build + - run: npm run build:webext + - name: Archive extension directory + uses: actions/upload-artifact@v2 + with: + name: extension + path: | + dist + web-ext-artifacts diff --git a/package.json b/package.json index edafde1..b4d44fb 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "watch:assets": "cpx --watch -v \"src/**/*.{json,png,svg}\" dist/", "build:parcel": "cross-env NODE_ENV=production parcel build --no-source-maps --no-minify \"src/scripts/*.{js,ts}\" \"src/**/*.html\"", "watch:parcel": "parcel watch --no-hmr --no-source-maps \"src/scripts/*.{js,jsx,ts,tsx}\" \"src/**/*.html\"", + "build:webext": "web-ext build --source-dir ./dist --overwrite-dest", "build": "npm-run-all -l -p build:parcel build:assets", "watch": "npm-run-all -l -p watch:parcel watch:assets", "start:chrome": "web-ext run -t chromium --source-dir ./dist",