Skip to content

Commit a090992

Browse files
authored
Merge pull request #36 from contentpass/CP-2520-Configure-automatic-release-from-CI
CP-2520 Configure automatic release from CI
2 parents 29944a9 + 8e3a153 commit a090992

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

.github/workflows/release.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Release & Publish to NPM
2+
on: workflow_dispatch
3+
4+
jobs:
5+
release:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v4
10+
11+
- name: Setup
12+
uses: ./.github/actions/setup
13+
14+
- name: Initialise the NPM config
15+
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
16+
env:
17+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
18+
19+
- name: Run release
20+
run: npm run release --ci
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,6 @@ ios/generated
8484
android/generated
8585

8686
/coverage/
87+
88+
# to not commit NPM token
89+
.npmrc

.release-it.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
]
1010
},
1111
"git": {
12+
"requireBranch": "main",
1213
"commitMessage": "chore: release ${version}",
1314
"tagName": "v${version}"
1415
},

0 commit comments

Comments
 (0)