Skip to content

Commit f8cbbd4

Browse files
committed
ci: ✨ updated test and release workflows
1 parent d3b4de2 commit f8cbbd4

File tree

5 files changed

+38
-26
lines changed

5 files changed

+38
-26
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
name: Manual NPM Publish
1+
name: Release to NPM and GitHub
22

33
on:
44
workflow_dispatch:
55
inputs:
66
releaseType:
7-
description: "Release type - major, minor or patch"
7+
description: "Release Type"
88
required: true
9+
type: choice
10+
options:
11+
- "major"
12+
- "minor"
13+
- "patch"
914
default: "patch"
10-
distTag:
11-
description: 'NPM tag (e.g. use "next" to release a test version)'
12-
required: true
13-
default: "latest"
1415

1516
env:
1617
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -23,23 +24,23 @@ jobs:
2324
with:
2425
ref: "main"
2526
fetch-depth: 0
27+
2628
- uses: actions/setup-node@v3
2729
with:
28-
node-version: 14.x
30+
node-version: 16
31+
2932
- name: NPM Setup
30-
run: |
31-
npm set registry "https://registry.npmjs.org/"
32-
npm set //registry.npmjs.org/:_authToken $NPM_TOKEN
33-
npm whoami
33+
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
34+
3435
- name: Git Setup
3536
run: |
36-
git config user.name $GITHUB_ACTOR
37-
git config user.email gh-actions-${GITHUB_ACTOR}@github.com
38-
git remote add gh-origin https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
37+
git config user.name "${GITHUB_ACTOR}"
38+
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
39+
3940
- name: Install Dependencies
4041
run: npm ci
42+
4143
- name: Release
4244
run: npm run release.ci -- ${{github.event.inputs.releaseType}}
4345
env:
44-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4546
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: multiple-cucumber-html-reporter
1+
name: Test multiple-cucumber-html-reporter
22

33
on:
44
push:
@@ -8,26 +8,25 @@ on:
88
branches:
99
- main
1010

11-
defaults:
12-
run:
13-
working-directory: ./
14-
1511
jobs:
1612
test:
1713
runs-on: ubuntu-latest
14+
1815
strategy:
1916
matrix:
20-
node-version: [14.x]
17+
node-version: [16]
18+
2119
steps:
2220
- name: Checkout Repository
2321
uses: actions/checkout@v3
22+
2423
- name: Setup Node.js ${{ matrix.node-version }}
2524
uses: actions/setup-node@v3
2625
with:
27-
node-version: ${{ matrix.node-version }}
26+
node-version: ${{ matrix.node-version }}
27+
2828
- name: Install dependencies
29-
working-directory: ./
3029
run: npm ci
30+
3131
- name: Run Unit Tests and generate coverage report
32-
working-directory: ./
3332
run: npm run unit.test.coverage

.release-it.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"git": {
3+
"requireBranch": "main",
4+
"commitMessage": "chore: release v${version}"
5+
},
6+
"github": {
7+
"release": true
8+
},
9+
"npm": {
10+
"publish": true
11+
}
12+
}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Wim Selles
3+
Copyright (c) 2023 Wasiq Bhamla
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "multiple-cucumber-html-reporter",
3-
"version": "3.2.0",
3+
"version": "3.3.0",
44
"description": "Generate beautiful Cucumber.js reports for multiple instances (browsers / devices)",
55
"keywords": [
66
"cucumber",

0 commit comments

Comments
 (0)