diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..b0703bc --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,34 @@ +name: Build library + +on: + push: + branches: + - master + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node: [12, 14] + steps: + - uses: actions/checkout@master + - name: Cache node modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + - name: Setup node + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + registry-url: https://registry.npmjs.org/ + - name: Compile typescript + run: npm run build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index dc40c3f..1f27ff4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,8 +11,8 @@ jobs: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 with: - node-version: 12 + node-version: 14 registry-url: https://registry.npmjs.org/ - run: npm publish --unsafe-perm env: - NODE_AUTH_TOKEN: ${{secrets.NPM_SECRET}} \ No newline at end of file + NODE_AUTH_TOKEN: ${{secrets.NPM_SECRET}}