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
20 changes: 20 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,23 @@ You could also be critic with existing ticket/PR : all constructive feedbacks ar
* launch tests using `pnpm test`.

Think about environment setup.


## HowTo create a fresh version
- use patch or minor or major workflow

this will make a new version and on version tag, the main ci workflow will push a new npmjs version too.

## HowTo release using `gh`

Install and create automatically a draft release version using [gh client](https://cli.github.com/)
- the version tag must exist

Example to create v1.1.0
```bash
gh release create v1.1.0 --draft --generate-notes
```
this will make a new draft release. Verify it in [releases list](https://github.com/creharmony/node-hook-action/releases)

- ⚠️ the repository apply immutable releases since #15 (`v1.1.0`), so you can't modify a release once published
- publish the release when ready
37 changes: 37 additions & 0 deletions .github/workflows/major.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: major
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
# version from package.json
run_install: false

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Major
run: |
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git config --global user.name 'github-actions[bot]'
git fetch --all
git checkout main
pnpm version major
git branch -f npmjs
git push origin main npmjs --tags
37 changes: 37 additions & 0 deletions .github/workflows/minor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: minor
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
# version from package.json
run_install: false

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Minor
run: |
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git config --global user.name 'github-actions[bot]'
git fetch --all
git checkout main
pnpm version minor
git branch -f npmjs
git push origin main npmjs --tags
3 changes: 1 addition & 2 deletions .github/workflows/patch.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# create patch from 'main' branch
name: nha-patch
name: patch
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down