From 995a461448789dd35b2fcac98740ce2e1863ffaf Mon Sep 17 00:00:00 2001 From: saikrishna321 Date: Mon, 24 Jun 2024 10:37:56 +0530 Subject: [PATCH 1/2] label pr test --- .github/workflows/npm-publish.yml | 57 +++++++++++++++++++------------ 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 97aee75..6b19b84 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -1,32 +1,47 @@ -# 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://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages - -name: Node.js Package - +name: Release Device Farm to NPM on: - release: - types: [created] + push: + branches: + - main + tags: + - '*.*.*' + pull_request: + types: + - labeled jobs: - build: + release: + if: github.event.action != 'labeled' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v2 + # Get tag name. + - id: tag + uses: haya14busa/action-cond@v1 with: - node-version: 16 - - run: npm ci + cond: "${{ startsWith(github.ref, 'refs/tags/') }}" + if_true: ${{ github.ref }} + if_false: ${{ steps.bumpr.outputs.next_version }} - publish-npm: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 + - name: Release + uses: justincy/github-action-npm-release@2.0.2 + id: release - uses: actions/setup-node@v3 + if: steps.release.outputs.released == 'true' with: + registry-url: 'https://registry.npmjs.org' node-version: 16 - registry-url: https://registry.npmjs.org/ - - run: npm ci - - run: npm publish + - name: Publish + if: steps.release.outputs.released == 'true' + run: echo "//registry.npmjs.org/:_authToken=${{secrets.npm_token}}" > .npmrc && npm ci && npm publish env: - NODE_AUTH_TOKEN: ${{secrets.npm_token}} + NODE_AUTH_TOKEN: ${{ secrets.npm_token }} + + + release-check: + if: github.event.action == 'labeled' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Post bumpr status comment + uses: haya14busa/action-bumpr@v1 From 418d43bc440069d3d88e5d85fb53428e3e681276 Mon Sep 17 00:00:00 2001 From: saikrishna321 Date: Mon, 24 Jun 2024 10:38:22 +0530 Subject: [PATCH 2/2] bump release --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index e80cd67..7a39083 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "node-release-github", - "version": "1.3.0", + "version": "1.3.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "node-release-github", - "version": "1.3.0", + "version": "1.3.1", "license": "ISC" } } diff --git a/package.json b/package.json index 48ad08e..09e35b7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-release-github", - "version": "1.3.0", + "version": "1.3.1", "description": "", "main": "index.js", "scripts": {