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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
coverage
*.d.ts
!.release-it.js
56 changes: 56 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release

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

jobs:
release:
runs-on: ubuntu-latest
concurrency: 1
environment: release

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}

- name: Setup Node.js version
uses: actions/setup-node@v3
with:
node-version: 20

- name: Enable yarn
run: corepack enable

- name: Install dependencies
run: |
echo "::group::Install required packages"
sudo apt update
sudo apt install -y pcregrep golang
echo "::endgroup::"

echo "::group::Install project dependencies"
yarn install --frozen-lockfile
echo "::endgroup::"

- name: Configure git
run: |
git config user.name "Uphold"
git config user.email "bot@uphold.com"

- name: Generate release
id: generate-release
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
run: yarn run release --increment "${{ github.event.inputs.VERSION_BUMP }}" -V
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '14', '16', '18']
node: [18, 20]

container:
image: node:${{ matrix.node }}-alpine
Expand Down
19 changes: 19 additions & 0 deletions .release-it.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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
`
}
};
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ const logger = require('debugnyan')('foo', {}, { suffix: 'module', simple: false

## Release

```sh
❯ yarn release ["major" | "minor" | "patch" | <custom version number>] # default: patch
```
Click on `Run Workflow` on the [release github action](https://github.com/uphold/debugnyan/actions/workflows/release.yaml)

## License

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@
"debug": "^4.3.4"
},
"devDependencies": {
"release-it": "^17.0.0",
"uphold-scripts": "^0.7.1"
},
"engines": {
"node": ">=14"
"node": ">=18"
},
"types": "index.d.ts"
}
Loading