From d5b555d15ff15a42c7543e430f5273ca4d816205 Mon Sep 17 00:00:00 2001 From: Pruthvi Shetty Date: Wed, 3 Aug 2022 15:55:23 +0530 Subject: [PATCH 1/2] adds release action --- .github/workflows/npm-publish.yml | 44 +++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/npm-publish.yml diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..9bac903 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,44 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages + +name: Node.js Package + +on: + release: + types: [created] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: https://registry.npmjs.org/ + + - uses: pnpm/action-setup@v2.0.1 + name: Install pnpm + id: pnpm-install + with: + version: 7 + run_install: false + + - name: Get pnpm store directory + id: pnpm-cache + run: | + echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" + + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + - name: Install dependencies and build 🔧 + run: pnpm i && pnpm build + - name: Publish package on NPM 📦 + run: cd ./lib && pnpm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} From 49d0e44d3ee667e9a1cf81b69abfa8a18e9ce0db Mon Sep 17 00:00:00 2001 From: Pruthvi Shetty Date: Wed, 3 Aug 2022 16:05:10 +0530 Subject: [PATCH 2/2] sets up for v 0.1.6 --- .github/workflows/npm-publish.yml | 49 +++++++++++++++---------------- lib/package.json | 2 +- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 9bac903..1120a41 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -1,43 +1,42 @@ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages -name: Node.js Package +name: Publish to NPM on: release: types: [created] - jobs: - publish: - runs-on: ubuntu-latest + build: + name: Build and Publish + timeout-minutes: 15 + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v3 + - name: Check out code + uses: actions/checkout@v2 with: - node-version: 16 - registry-url: https://registry.npmjs.org/ + fetch-depth: 2 - uses: pnpm/action-setup@v2.0.1 - name: Install pnpm - id: pnpm-install with: - version: 7 - run_install: false - - - name: Get pnpm store directory - id: pnpm-cache - run: | - echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" + version: 6.32.2 - - uses: actions/cache@v3 - name: Setup pnpm cache + - name: Setup Node.js environment + uses: actions/setup-node@v2 with: - path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - name: Install dependencies and build 🔧 - run: pnpm i && pnpm build + node-version: 16 + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Build + run: pnpm build + - name: Publish package on NPM 📦 run: cd ./lib && pnpm publish env: diff --git a/lib/package.json b/lib/package.json index 512660a..9c7dd67 100644 --- a/lib/package.json +++ b/lib/package.json @@ -1,6 +1,6 @@ { "name": "@hover-design/react", - "version": "0.1.5", + "version": "0.1.6", "description": "Hover Component library created by bunch of ants from antstack", "license": "MIT", "main": "dist/hover-react.es.js",