From 17371a08330e191201f6df39d452e743515f8c48 Mon Sep 17 00:00:00 2001 From: Wasiq Bhamla Date: Sat, 23 Dec 2023 22:03:32 +0530 Subject: [PATCH] fix: :bug: fixed failing release workflow (#304) --- .github/workflows/release.yml | 26 ++++++++++++++++---------- .release-it.json | 14 ++++++++++++-- package-lock.json | 4 ++-- package.json | 12 ++++++------ 4 files changed, 36 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 73d304a5..fe7a889c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,9 +13,6 @@ on: - "patch" default: "patch" -env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - jobs: release: runs-on: ubuntu-latest @@ -25,6 +22,19 @@ jobs: ref: "main" fetch-depth: 0 + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v6 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.GPG_PASSPHRASE }} + git_user_signingkey: true + git_commit_gpgsign: true + + - name: git config + run: | + git config user.name "${GITHUB_ACTOR}" + git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" + - uses: actions/setup-node@v4 with: node-version: 16 @@ -32,15 +42,11 @@ jobs: - name: NPM Setup run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN - - name: Git Setup - run: | - git config user.name "${GITHUB_ACTOR}" - git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" - - name: Install Dependencies run: npm ci - name: Release - run: npm run release.ci -- ${{github.event.inputs.releaseType}} + run: npm run release.${{ github.event.inputs.releaseType }} env: - GITHUB_TOKEN: ${{ secrets.PUSH_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + PUSH_TOKEN: ${{ secrets.PUSH_TOKEN }} diff --git a/.release-it.json b/.release-it.json index 2a09b516..35819816 100644 --- a/.release-it.json +++ b/.release-it.json @@ -1,10 +1,20 @@ { "git": { "requireBranch": "main", - "commitMessage": "chore: release v${version}" + "commitMessage": "chore: release v${version}", + "commit": true, + "tag": true, + "push": true, + "requireCleanWorkingDir": true }, "github": { - "release": true + "release": true, + "tokenRef": "PUSH_TOKEN", + "comments": { + "submit": true, + "issue": ":rocket: _This issue has been resolved in v${version}. See [${releaseName}](${releaseUrl}) for release notes._", + "pr": ":rocket: _This pull request is included in v${version}. See [${releaseName}](${releaseUrl}) for release notes._" + } }, "npm": { "publish": true diff --git a/package-lock.json b/package-lock.json index 67374c38..2184367b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "multiple-cucumber-html-reporter", - "version": "3.4.0", + "version": "3.5.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "multiple-cucumber-html-reporter", - "version": "3.4.0", + "version": "3.5.0", "license": "MIT", "dependencies": { "find": "^0.3.0", diff --git a/package.json b/package.json index 5c93c6e7..b8324813 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "multiple-cucumber-html-reporter", - "version": "3.4.0", + "version": "3.5.0", "description": "Generate beautiful Cucumber.js reports for multiple instances (browsers / devices)", "keywords": [ "cucumber", @@ -13,11 +13,11 @@ "main": "lib/generate-report.js", "license": "MIT", "scripts": { - "release": "release-it --github.release", - "release.ci": "npm run release -- --ci --npm.skipChecks --no-git.requireCleanWorkingDir", - "release.patch": "npm run release -- patch", - "release.minor": "npm run release -- minor", - "release.major": "npm run release -- major", + "release": "release-it", + "release.ci": "npm run release -- --ci", + "release.patch": "npm run release.ci -- patch", + "release.minor": "npm run release.ci -- minor", + "release.major": "npm run release.ci -- major", "test": "node ./test/test.js", "unit.test": "jasmine JASMINE_CONFIG_PATH=test/unit/jasmine.json", "unit.test.coverage": "JASMINE_CONFIG_PATH=test/unit/jasmine.json nyc jasmine"