From 932810e8a1b0b155cf517d46da88d15acf87083f Mon Sep 17 00:00:00 2001 From: panayiotisgeorgiou Date: Wed, 25 Oct 2023 00:43:26 +0300 Subject: [PATCH] create github action for npm --- .github/workflows/npm-publish.yml | 28 ++++++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 30 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..7da2e35 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,28 @@ +name: Publish to npm + +on: + push: + tags: + - "*" + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: 14 + + - name: Install dependencies + run: npm install + + - name: Publish to npm + run: | + echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc + npm publish + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/README.md b/README.md index 0955065..4ba9575 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![npm](https://img.shields.io/npm/v/react-native-braintree.svg)](https://www.npmjs.com/package/react-native-braintree) + # @ekreative/react-native-braintree ## Getting started