Skip to content

Commit

Permalink
[EE-1663] migrate from jenkins to gha (#74)
Browse files Browse the repository at this point in the history
* migrate from jenkins to gha

* update

* update readme
  • Loading branch information
thomaschaplin authored Jul 28, 2023
1 parent fffaf4d commit 3c6f542
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 83 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: NPM Publish

on:
workflow_dispatch:
inputs:
semver:
description: 'Semantic Version'
required: true
type: choice
options:
- patch
- minor
- major

concurrency:
group: npm-publish

jobs:
publish:
runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write

steps:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: npm

- name: Configure GIT User
run: |
git config --global user.email "[email protected]"
git config --global user.name "Tray.io GHA"
- name: Login to NPM
run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.CONNECTOR_UTILS_NPM_TOKEN }}

- name: Install
run: npm ci

- name: Bump version
run: npm version ${{ inputs.semver }}

- name: Publish to NPM
run: npm publish

- name: Push Tags
run: git push --tags

- name: Create a Pull Request with the new version
uses: peter-evans/create-pull-request@v4
with:
token: ${{ github.token }}
title: '[EE-1663] Update package version from npm publish'
body: 'These changes were automatically produced by the "NPM Publish" workflow'
base: master
branch: gha/EE-1663/update-lock-file-from-npm-publish
commit-message: Update package version from npm publish
31 changes: 31 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Pull Request

on:
push:
branches:
- '**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest

timeout-minutes: 5

steps:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: npm

- name: Install
run: npm ci

- name: Test
run: npm test
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ A full breakdown of available utilities is included in the documentation below.

Please be sure to add any discovered issues or improvement recommendations to the `Issues` tab of this repo.

## Deploying

Once a PR is merged into master, you will need to go into GitHub Actions UI and trigger the `NPM Publish` workflow manually providing the input of `major`, `minor` or `patch` depending on what version bump you want to publish - this will automatically build, tag, and publish the new version.

Once the pipeline is done, a github tag will appear with the new version number. You will need to merge in the automatically generated pull request which bumps the package version. You can then use this tag to create a Github release with some release notes.


# Documentation

## Classes
Expand Down Expand Up @@ -143,16 +150,16 @@ for arrays).</p>

Class representing the base error for all connector errors

**Kind**: global class
**Extends**: <code>Error</code>
**Kind**: global class
**Extends**: <code>Error</code>
<a name="UserInputError"></a>

## UserInputError ⇐ [<code>GenericError</code>](#GenericError)

Class representing a UserInputError

**Kind**: global class
**Extends**: [<code>GenericError</code>](#GenericError)
**Kind**: global class
**Extends**: [<code>GenericError</code>](#GenericError)
<a name="new_UserInputError_new"></a>

### new UserInputError(message, ...errorArgs)
Expand All @@ -170,8 +177,8 @@ Custom error to throw for issues concerning User Input.

Class representing a ConnectorError

**Kind**: global class
**Extends**: [<code>GenericError</code>](#GenericError)
**Kind**: global class
**Extends**: [<code>GenericError</code>](#GenericError)
<a name="new_ConnectorError_new"></a>

### new ConnectorError(message, ...errorArgs)
Expand All @@ -189,8 +196,8 @@ Custom error to throw for issues concerning the Connector.

Class representing a ConnectorError

**Kind**: global class
**Extends**: [<code>GenericError</code>](#GenericError)
**Kind**: global class
**Extends**: [<code>GenericError</code>](#GenericError)
<a name="new_ApiError_new"></a>

### new ApiError(message, ...errorArgs)
Expand All @@ -208,8 +215,8 @@ Custom error to throw for issues concerning the Api;;.

Class representing a ConnectorError

**Kind**: global class
**Extends**: [<code>GenericError</code>](#GenericError)
**Kind**: global class
**Extends**: [<code>GenericError</code>](#GenericError)
<a name="new_OAuthRefresh_new"></a>

### new OAuthRefresh(message, ...errorArgs)
Expand All @@ -227,8 +234,8 @@ Custom error to throw when an oAuth token has expired.

Class representing a ConnectorError

**Kind**: global class
**Extends**: [<code>GenericError</code>](#GenericError)
**Kind**: global class
**Extends**: [<code>GenericError</code>](#GenericError)
<a name="new_NoTriggerError_new"></a>

### new NoTriggerError(message, ...errorArgs)
Expand Down
40 changes: 0 additions & 40 deletions publish.Jenkinsfile

This file was deleted.

31 changes: 0 additions & 31 deletions scripts/publish.sh

This file was deleted.

0 comments on commit 3c6f542

Please sign in to comment.