From 4a6aa382fced40c016ee92e22295303a9fec5d38 Mon Sep 17 00:00:00 2001 From: Kunal Nagar Date: Sat, 8 May 2021 15:36:30 -0400 Subject: [PATCH] Switch to yarn --- .github/workflows/build.yml | 16 ++++++++-------- .github/workflows/npm.yml | 22 ---------------------- .github/workflows/release-npm.yml | 26 ++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 30 deletions(-) delete mode 100644 .github/workflows/npm.yml create mode 100644 .github/workflows/release-npm.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6161a32..f0e974c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,15 +19,15 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - - name: Install npm dependencies - run: npm install + - name: Install dependencies + run: yarn install --frozen-lockfile - name: Lint code - run: npm run lint - - name: Create npm build - run: npm run build + run: yarn lint + - name: Create build + run: yarn build - name: Run tests - run: npm test + run: yarn test - name: Upload test coverage uses: codecov/codecov-action@v1 - - name: Create npm tarball (dry-run) - run: npm pack + - name: Create release tarball (dry-run) + run: yarn pack diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml deleted file mode 100644 index b17d700..0000000 --- a/.github/workflows/npm.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Release to npm - -on: - release: - types: [published] - -jobs: - release: - runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2-beta - with: - node-version: '14' - - name: Install npm dependencies - run: npm install - - name: Create build - run: npm run build - - name: Authenticate with the npm registry - run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc - - name: Release to npm - run: npm publish --access public diff --git a/.github/workflows/release-npm.yml b/.github/workflows/release-npm.yml new file mode 100644 index 0000000..db8a52a --- /dev/null +++ b/.github/workflows/release-npm.yml @@ -0,0 +1,26 @@ +name: Release to npm + +on: + release: + types: [published] + +jobs: + release: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [10.x, 12.x, 14.x, 15.x, 16.x] + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Install dependencies + run: yarn install --frozen-lockfile + - name: Create build + run: yarn build + - name: Authenticate with the npm registry + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc + - name: Release to npm + run: yarn publish --access public