Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release

on:
workflow_dispatch:
inputs:
VERSION_BUMP:
description: 'The version bump'
type: choice
options:
- major
- minor
- patch
default: minor
required: true

jobs:
release:
environment: release
runs-on: ubuntu-latest
concurrency:
group: release-${{ github.repository }}-${{ github.ref_name }}
cancel-in-progress: false

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Node.js version
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Configure git
run: |
git config user.name "Uphold"
git config user.email "bot@uphold.com"
git config --global url.https://${{ secrets.RELEASE_GITHUB_TOKEN }}@github.com/.insteadOf https://github.com/

- name: Configure npm
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.RELEASE_NPM_TOKEN }}

- name: Generate release
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
run: npm run release -- --increment "${{ github.event.inputs.VERSION_BUMP }}" -V
22 changes: 22 additions & 0 deletions .release-it.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
git: {
changelog: 'echo "## Changelog\\n\\n$(npx @uphold/github-changelog-generator -f unreleased | tail -n +4 -f)"',
commitMessage: 'Release ${version}',
requireBranch: 'master',
requireCommits: true,
tagName: 'v${version}'
},
github: {
release: true,
releaseName: 'v${version}'
},
hooks: {
'after:bump': `
echo "$(npx @uphold/github-changelog-generator -f v\${version})\n$(tail -n +2 CHANGELOG.md)" > CHANGELOG.md &&
git add CHANGELOG.md --all
`
},
npm: {
publish: true
}
};
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,16 @@ A full coverage report will be generated on `/coverage` folder.

Please create a PR with a description of the changes, its motivation and impacted areas, making sure the build passes.

## Release
## Release process

```sh
yarn release [<version> | major | minor | patch]
```
The release of a version is automated via the [release](https://github.com/uphold/uphold-validator.js/.github/workflows/release.yml) GitHub workflow.
Run it by clicking the "Run workflow" button.

## License

MIT

[npm-image]: https://img.shields.io/npm/v/@uphold/http-errors.svg
[npm-url]: https://www.npmjs.com/package/@uphold/http-errors
[tests-image]: https://github.com/uphold/uphold-http-errors/actions/workflows/tests.yaml/badge.svg?branch=master
[tests-url]: https://github.com/uphold/uphold-http-errors/actions/workflows/tests.yaml
[tests-image]: https://github.com/uphold/http-errors/actions/workflows/tests.yaml/badge.svg?branch=master
[tests-url]: https://github.com/uphold/http-errors/actions/workflows/tests.yaml
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
"license": "MIT",
"author": "Uphold",
"main": "src/index.js",
"files": [
"src"
],
"types": "types/index.d.ts",
"scripts": {
"changelog": "github-changelog-generator --future-release=v$npm_package_version > CHANGELOG.md",
"lint": "eslint",
"release": "npm version $1 -m 'Release %s'",
"release": "release-it",
"test": "node --test test/**/*_test.js",
"test:coverage": "NODE_V8_COVERAGE=coverage node --test --experimental-test-coverage test/**/*_test.js",
"test:watch": "node --test --watch test/**/*_test.js",
"version": "yarn changelog && git add CHANGELOG.md"
"test:watch": "node --test --watch test/**/*_test.js"
},
"pre-commit": [
"lint"
Expand All @@ -23,11 +24,12 @@
"standard-http-error": "2.0.1"
},
"devDependencies": {
"@uphold/github-changelog-generator": "^0.7.0",
"@uphold/github-changelog-generator": "^4.0.2",
"eslint": "^9.28.0",
"eslint-config-uphold": "^6.5.1",
"pre-commit": "1.2.2",
"prettier": "^3.5.3"
"prettier": "^3.5.3",
"release-it": "^19.0.3"
},
"engines": {
"node": ">=20"
Expand Down
Loading