From aef08caa65f90b6249f753276d4ae5984f17b57f Mon Sep 17 00:00:00 2001 From: Xetera Date: Thu, 4 Mar 2021 18:38:05 +0300 Subject: [PATCH] Added missing CI step for prs and master push (#50) * added a build step to prs and pushed commits * upgraded publishing node version to LTS * added name to node setup --- .github/workflows/build.yml | 34 ++++++++++++++++++++++++++++++++++ .github/workflows/publish.yml | 4 ++-- 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build.yml 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}}