From 44b1953cd2906951cfc4e5bed41b4deeca8a83d9 Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Fri, 27 Sep 2024 10:08:18 +0530 Subject: [PATCH] adds publish to npm step --- .github/workflows/publish.yml | 34 ++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..fa9fb775 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,34 @@ +name: Publish +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout xero-node repo + uses: actions/checkout@v4 + with: + repository: XeroAPI/xero-node + path: xero-node + + - name: Set up Node environment + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + cache-dependency-path: '**/package-lock.json' + + - name: Install dependencies + run: npm ci + working-directory: xero-node + + - name: Run Build + run: npm run build + working-directory: xero-node + + - name: Publish to npm + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} + run: npm publish diff --git a/package.json b/package.json index 47485b0a..2cc5b279 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xero-node", - "version": "9.3.0", + "version": "9.3.0-alpha", "description": "Xero NodeJS OAuth 2.0 client for xero-node", "main": "dist/index.js", "types": "dist/index.d.ts",