Skip to content

Commit

Permalink
ci: ✨ updated test and release workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
WasiqB committed May 2, 2023
1 parent d3b4de2 commit f8cbbd4
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 26 deletions.
31 changes: 16 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
Expand All @@ -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 }}
17 changes: 8 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: multiple-cucumber-html-reporter
name: Test multiple-cucumber-html-reporter

on:
push:
Expand All @@ -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
12 changes: 12 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"git": {
"requireBranch": "main",
"commitMessage": "chore: release v${version}"
},
"github": {
"release": true
},
"npm": {
"publish": true
}
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit f8cbbd4

Please sign in to comment.