From f8cbbd495ac72759d0370594c5e426543a77382c Mon Sep 17 00:00:00 2001 From: WasiqB Date: Tue, 2 May 2023 17:43:55 +0530 Subject: [PATCH] ci: :sparkles: updated test and release workflows --- .github/workflows/release.yml | 31 ++++++++++++++++--------------- .github/workflows/test.yml | 17 ++++++++--------- .release-it.json | 12 ++++++++++++ LICENSE | 2 +- package.json | 2 +- 5 files changed, 38 insertions(+), 26 deletions(-) create mode 100644 .release-it.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 98fd2d1d..30993ddd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,16 +1,17 @@ -name: Manual NPM Publish +name: Release to NPM and GitHub on: workflow_dispatch: inputs: releaseType: - description: "Release type - major, minor or patch" + description: "Release Type" required: true + type: choice + options: + - "major" + - "minor" + - "patch" default: "patch" - distTag: - description: 'NPM tag (e.g. use "next" to release a test version)' - required: true - default: "latest" env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -23,23 +24,23 @@ jobs: with: ref: "main" fetch-depth: 0 + - uses: actions/setup-node@v3 with: - node-version: 14.x + node-version: 16 + - name: NPM Setup - run: | - npm set registry "https://registry.npmjs.org/" - npm set //registry.npmjs.org/:_authToken $NPM_TOKEN - npm whoami + run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN + - name: Git Setup run: | - git config user.name $GITHUB_ACTOR - git config user.email gh-actions-${GITHUB_ACTOR}@github.com - git remote add gh-origin https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git + 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}} env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c3289efe..6795977a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: multiple-cucumber-html-reporter +name: Test multiple-cucumber-html-reporter on: push: @@ -8,26 +8,25 @@ on: branches: - main -defaults: - run: - working-directory: ./ - jobs: test: runs-on: ubuntu-latest + strategy: matrix: - node-version: [14.x] + node-version: [16] + steps: - name: Checkout Repository uses: actions/checkout@v3 + - name: Setup Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ matrix.node-version }} + - name: Install dependencies - working-directory: ./ run: npm ci + - name: Run Unit Tests and generate coverage report - working-directory: ./ run: npm run unit.test.coverage diff --git a/.release-it.json b/.release-it.json new file mode 100644 index 00000000..2a09b516 --- /dev/null +++ b/.release-it.json @@ -0,0 +1,12 @@ +{ + "git": { + "requireBranch": "main", + "commitMessage": "chore: release v${version}" + }, + "github": { + "release": true + }, + "npm": { + "publish": true + } +} diff --git a/LICENSE b/LICENSE index 09bef9c2..a4cec096 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 Wim Selles +Copyright (c) 2023 Wasiq Bhamla Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/package.json b/package.json index 3f6863c8..8e667012 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "multiple-cucumber-html-reporter", - "version": "3.2.0", + "version": "3.3.0", "description": "Generate beautiful Cucumber.js reports for multiple instances (browsers / devices)", "keywords": [ "cucumber",