Skip to content

Commit f7eaece

Browse files
chore(SCM-791): add pipeline to publish npm (#123)
1 parent d2c048f commit f7eaece

File tree

4 files changed

+3248
-87
lines changed

4 files changed

+3248
-87
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: NPM release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
release:
8+
name: Release
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Install Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 20
20+
21+
- name: Install dependencies
22+
run: yarn install
23+
24+
- name: Build package
25+
run: yarn prepublishOnly
26+
27+
- name: Release
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
31+
run: yarn release

package.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{
22
"name": "react-intl-phraseapp",
3-
"version": "5.0.1",
3+
"version": "5.0.2",
44
"description": "The In-Context-Editor for react using react-intl",
55
"homepage": "https://phrase.com",
66
"scripts": {
77
"test": "jest",
88
"dev": "webpack-cli --mode development",
99
"dist": "webpack-cli --mode production",
10-
"prepublishOnly": "rm -rf dist/ && npm run dist"
10+
"prepublishOnly": "rm -rf dist/ && npm run dist",
11+
"release:dry-run": "semantic-release -d",
12+
"release": "semantic-release"
1113
},
1214
"keywords": [
1315
"react",
@@ -17,9 +19,19 @@
1719
"localization",
1820
"phrase"
1921
],
22+
"repository": {
23+
"type": "git",
24+
"url": "https://github.com/phrase/react-intl-phraseapp.git"
25+
},
26+
"bugs": {
27+
"url": "https://github.com/phrase/react-intl-phraseapp/issues",
28+
"email": "[email protected]"
29+
},
2030
"author": "Phrase",
2131
"license": "MIT",
2232
"devDependencies": {
33+
"@semantic-release/changelog": "^6.0.3",
34+
"@semantic-release/git": "^10.0.1",
2335
"@testing-library/dom": "^10.4.1",
2436
"@testing-library/react": "^16.3.0",
2537
"@types/jest": "^30.0.0",
@@ -33,6 +45,7 @@
3345
"react-dom": "^19.1.1",
3446
"react-intl": "^7.1.11",
3547
"react-test-renderer": "^19.1.1",
48+
"semantic-release": "24",
3649
"ts-jest": "^29.4.1",
3750
"ts-loader": "^9.5.4",
3851
"typescript": "^5.9.2",

release.config.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = {
2+
"branches": ["main"],
3+
"plugins": [
4+
["@semantic-release/commit-analyzer", {
5+
"releaseRules": [
6+
{ "type": "chore", "scope": "deps", "release": "patch" },
7+
{ "type": "docs", "scope": "README", "release": "patch" },
8+
]
9+
}],
10+
"@semantic-release/release-notes-generator",
11+
"@semantic-release/changelog",
12+
["@semantic-release/npm", {
13+
"pkgRoot": "dist/",
14+
"tarballDir": "release"
15+
}],
16+
"@semantic-release/github",
17+
"@semantic-release/git"
18+
],
19+
};

0 commit comments

Comments
 (0)