From 343c60c1995e97197ff968fcb531436baa87e2b3 Mon Sep 17 00:00:00 2001 From: Alex Babrykovich Date: Thu, 4 Apr 2024 21:34:05 +0200 Subject: [PATCH] chore: do npm publish on release event (#54) * chore: do npm publish on release event * docs: apply review feedback Co-authored-by: e271828- --------- Co-authored-by: e271828- --- .github/workflows/tests.yaml | 6 +++--- MAINTAINER.md | 13 +++++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 8eaa486..cac3d11 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -2,7 +2,7 @@ name: CI on: push: branches: [ master ] - tags: [ '*' ] + release: pull_request: workflow_dispatch: schedule: @@ -121,11 +121,11 @@ jobs: update_existing: true filename: .github/examples-issue-template.md release: - if: startsWith(github.ref, 'refs/tags') && endsWith(github.event.base_ref, 'master') + if: github.event_name == 'release' needs: [test-npm, test-yarn] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: npm release env: diff --git a/MAINTAINER.md b/MAINTAINER.md index 43950c4..a941f09 100644 --- a/MAINTAINER.md +++ b/MAINTAINER.md @@ -1,18 +1,23 @@ ### Release steps -**Note:** we use [SemVer format](https://semver.org/). +1. Pick the right version number: + +**Note:** we use [SemVer format](https://semver.org/): MAJOR: breaking change. MINOR: new feature(s), backwards compatible. PATCH: bugfix only. -Prepare a PR: +2. Prepare a PR: - bump [`package.json's`](./package.json) version - run `npm i` to update `package-lock.json` - commit `package.json` and `package-lock.json` - -After merging PR and tests pass CI will do `npm publish`: +- open the PR for review +- once the PR is approved and merged to master: + - set the tag on master matching your version: git tag `vM.M.P` + - draft a new release https://github.com/hCaptcha/react-native-hcaptcha/releases +- once the release is created, CI will release the new version to https://www.npmjs.com/package/@hcaptcha/react-native-hcaptcha?activeTab=versions ### Generate test app