diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 00000000..69f79773 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,34 @@ +name: Publish to npm + +on: + release: + types: [created] + +jobs: + publish-npm: + runs-on: ubuntu-latest + defaults: + run: + working-directory: packages/sdk/js + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: "16" + registry-url: "https://registry.npmjs.org" + + - name: Install dependencies + run: npm install + + - name: Publish JS SDK to NPM + run: npm publish --workspace=sdk/js + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Publish React components to NPM + run: npm publish --workspace=ui/lib + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index 8f213921..109f1eaa 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "apepay-js-root", "type": "module", - "private": true, + "private": false, "workspaces": [ "sdk/js", "ui/lib", diff --git a/sdk/js/package.json b/sdk/js/package.json index 7fb09c35..03ff50c8 100644 --- a/sdk/js/package.json +++ b/sdk/js/package.json @@ -1,6 +1,6 @@ { "name": "@apeworx/apepay", - "version": "0.1.2", + "version": "0.1.3", "author": "ApeWorX LTD.", "license": "Apache-2.0", "type": "module", diff --git a/ui/lib/package.json b/ui/lib/package.json index 3b79e3ad..61581e58 100644 --- a/ui/lib/package.json +++ b/ui/lib/package.json @@ -1,6 +1,6 @@ { "name": "@apeworx/apepay-react", - "version": "0.1.1", + "version": "0.1.2", "author": "ApeWorX LTD.", "license": "Apache-2.0", "type": "module",