Skip to content

Commit

Permalink
feat: added semantic-release integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio committed Oct 26, 2020
1 parent 2da90b1 commit 88128f2
Show file tree
Hide file tree
Showing 5 changed files with 3,311 additions and 73 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Main CI

on:
workflow_dispatch:
inputs:
distTag:
description: 'Dist tag to publish'
required: true
default: 'latest'
pull_request:
push:
branches:
Expand All @@ -16,6 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false

- name: Restore cache
Expand All @@ -30,10 +37,21 @@ jobs:
always-auth: true
node-version: 12

- name: Creates local .npmrc
if: ${{github.event.inputs.distTag == 'latest'}}
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: Install
run: yarn install --frozen-lockfile

- name: Build & Testing
run: |
yarn build
yarn test
- name: Release
if: ${{github.event.inputs.distTag == 'latest'}}
run: |
git config --global user.email "[email protected]"
git config --global user.name "Lingui CI"
npm run release
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<h1>Lingui Codemods<sub>js</sub></h1>
<img src="https://github.com/lingui/codemods/workflows/Main%20CI/badge.svg" />
<a href="https://www.npmjs.com/package/@lingui/codemods/v/latest"><img src="https://img.shields.io/npm/v/@lingui/codemods/latest.svg" /></a>
<a href="https://github.com/semantic-release/semantic-release">
<img src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg" />
</a>


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

Expand Down
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"scripts": {
"test": "jest",
"build": "tsc && chmod 755 ./bin/lingui-codemod.js",
"jscodeshift": "jscodeshift"
"jscodeshift": "jscodeshift",
"release": "semantic-release"
},
"dependencies": {
"chalk": "^2.4.2",
Expand All @@ -34,14 +35,23 @@
"devDependencies": {
"@babel/core": "^7.12.3",
"@babel/preset-env": "^7.12.1",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"@types/jest": "^26.0.15",
"@types/jscodeshift": "^0.7.1",
"@types/node": "^14.14.0",
"jest": "^26.6.0",
"semantic-release": "^17.2.1",
"ts-jest": "^26.4.1",
"typescript": "^4.0.3"
},
"contributors": [
"Sergio Moreno <[email protected]>"
],
"keywords": [
"@lingui",
"lingui",
"jscodeshift",
"codemods"
]
}
23 changes: 23 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
branches: [
"main"
],
plugins: [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
[
"@semantic-release/npm",
{
npmPublish: true,
pkgRoot: "."
},
],
{
assets: ["package.json", "CHANGELOG.md"],
message: "chore(release): ${nextRelease.version} ${nextRelease.notes}",
path: "@semantic-release/git",
},
"@semantic-release/github"
],
};
Loading

0 comments on commit 88128f2

Please sign in to comment.