Skip to content

Commit 88128f2

Browse files
author
Sergio
committed
feat: added semantic-release integration
1 parent 2da90b1 commit 88128f2

File tree

5 files changed

+3311
-73
lines changed

5 files changed

+3311
-73
lines changed

.github/workflows/ci.yml

+18
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: Main CI
22

33
on:
4+
workflow_dispatch:
5+
inputs:
6+
distTag:
7+
description: 'Dist tag to publish'
8+
required: true
9+
default: 'latest'
410
pull_request:
511
push:
612
branches:
@@ -16,6 +22,7 @@ jobs:
1622
steps:
1723
- uses: actions/checkout@v2
1824
with:
25+
fetch-depth: 0
1926
persist-credentials: false
2027

2128
- name: Restore cache
@@ -30,10 +37,21 @@ jobs:
3037
always-auth: true
3138
node-version: 12
3239

40+
- name: Creates local .npmrc
41+
if: ${{github.event.inputs.distTag == 'latest'}}
42+
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
43+
3344
- name: Install
3445
run: yarn install --frozen-lockfile
3546

3647
- name: Build & Testing
3748
run: |
3849
yarn build
3950
yarn test
51+
52+
- name: Release
53+
if: ${{github.event.inputs.distTag == 'latest'}}
54+
run: |
55+
git config --global user.email "sergiomorenoalbert@gmail.com"
56+
git config --global user.name "Lingui CI"
57+
npm run release

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
<h1>Lingui Codemods<sub>js</sub></h1>
33
<img src="https://github.com/lingui/codemods/workflows/Main%20CI/badge.svg" />
44
<a href="https://www.npmjs.com/package/@lingui/codemods/v/latest"><img src="https://img.shields.io/npm/v/@lingui/codemods/latest.svg" /></a>
5+
<a href="https://github.com/semantic-release/semantic-release">
6+
<img src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg" />
7+
</a>
8+
59

610
This repository contains a collection of codemod scripts for use with [JSCodeshift](https://github.com/facebook/jscodeshift) that help update Lingui APIs.
711

package.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"scripts": {
2121
"test": "jest",
2222
"build": "tsc && chmod 755 ./bin/lingui-codemod.js",
23-
"jscodeshift": "jscodeshift"
23+
"jscodeshift": "jscodeshift",
24+
"release": "semantic-release"
2425
},
2526
"dependencies": {
2627
"chalk": "^2.4.2",
@@ -34,14 +35,23 @@
3435
"devDependencies": {
3536
"@babel/core": "^7.12.3",
3637
"@babel/preset-env": "^7.12.1",
38+
"@semantic-release/changelog": "^5.0.1",
39+
"@semantic-release/git": "^9.0.0",
3740
"@types/jest": "^26.0.15",
3841
"@types/jscodeshift": "^0.7.1",
3942
"@types/node": "^14.14.0",
4043
"jest": "^26.6.0",
44+
"semantic-release": "^17.2.1",
4145
"ts-jest": "^26.4.1",
4246
"typescript": "^4.0.3"
4347
},
4448
"contributors": [
4549
"Sergio Moreno <sergiomorenoalbert@gmail.com>"
50+
],
51+
"keywords": [
52+
"@lingui",
53+
"lingui",
54+
"jscodeshift",
55+
"codemods"
4656
]
4757
}

release.config.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = {
2+
branches: [
3+
"main"
4+
],
5+
plugins: [
6+
"@semantic-release/commit-analyzer",
7+
"@semantic-release/release-notes-generator",
8+
"@semantic-release/changelog",
9+
[
10+
"@semantic-release/npm",
11+
{
12+
npmPublish: true,
13+
pkgRoot: "."
14+
},
15+
],
16+
{
17+
assets: ["package.json", "CHANGELOG.md"],
18+
message: "chore(release): ${nextRelease.version} ${nextRelease.notes}",
19+
path: "@semantic-release/git",
20+
},
21+
"@semantic-release/github"
22+
],
23+
};

0 commit comments

Comments
 (0)