From 0927f59243228e8153dc14b4de8fc890cba8d53e Mon Sep 17 00:00:00 2001 From: Florian Ludot Date: Wed, 21 Sep 2022 20:57:23 +0900 Subject: [PATCH 1/5] feat: use lowercased name --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 74f8da9..1a9d059 100644 --- a/src/index.ts +++ b/src/index.ts @@ -28,7 +28,7 @@ import { CLIArgs } from './types'; const program = new Command(); program - .name('Jerome') + .name('jerome') .description('Auto localization for iOS.') .version(version, '-v, --version'); From b3d7f1d1face24a4111f68018c4eabc5aab795eb Mon Sep 17 00:00:00 2001 From: Florian Ludot Date: Wed, 21 Sep 2022 21:41:20 +0900 Subject: [PATCH 2/5] feat: remove duplicated npm run prebuild --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 984d975..90cc8d4 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "scripts": { "all": "npm audit && npm run prebuild && npm run build && npm run lint && npm test", "prebuild": "rimraf ./dist && node -p \"'export default ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts", - "build": "npm run prebuild && tsc", + "build": "tsc", "format": "prettier --write '**/*.ts'", "lint": "eslint .", "prepare": "husky install", From 74f8a38f6d3ba8ab285329b8468df9f62f4c3ff9 Mon Sep 17 00:00:00 2001 From: Florian Ludot Date: Wed, 21 Sep 2022 21:41:34 +0900 Subject: [PATCH 3/5] chore: update package for publish --- package-lock.json | 7 +++++-- package.json | 8 ++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 07212cb..0c8546b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "jerome", + "name": "@florianldt/jerome", "version": "0.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "jerome", + "name": "@florianldt/jerome", "version": "0.0.1", "license": "ISC", "dependencies": { @@ -16,6 +16,9 @@ "ora": "^5.4.1", "qs": "^6.11.0" }, + "bin": { + "jerome": "dist/index.js" + }, "devDependencies": { "@commitlint/cli": "^17.1.2", "@commitlint/config-conventional": "^17.1.0", diff --git a/package.json b/package.json index 90cc8d4..8935e52 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,11 @@ { - "name": "jerome", + "name": "@florianldt/jerome", "version": "0.0.1", "description": "Auto localization for iOS", + "main": "./dist/index.js", + "bin": { + "jerome": "./dist/index.js" + }, "scripts": { "all": "npm audit && npm run prebuild && npm run build && npm run lint && npm test", "prebuild": "rimraf ./dist && node -p \"'export default ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts", @@ -17,7 +21,7 @@ "type": "git", "url": "git+https://github.com/florianldt/jerome.git" }, - "keywords": ["iOS", "localization", "translation", "jerome"], + "keywords": ["iOS", "localization", "translation", "jerome", "cli"], "author": "Florian Ludot", "license": "ISC", "bugs": { From 5fd699802fdbf43fb9240618ce88ebaa663b9d52 Mon Sep 17 00:00:00 2001 From: Florian Ludot Date: Wed, 21 Sep 2022 21:42:15 +0900 Subject: [PATCH 4/5] chore: add workflow_dispatch and setup node to test workflow --- .github/workflows/test.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 99b62a3..a5a8242 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,11 +5,17 @@ on: branches: - master + workflow_dispatch: + jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: 'Setup Node' + uses: actions/setup-node@v2 + with: + node-version: '14.x' - name: 'Install dependencies, audit, build, lint and test' run: | npm ci --ignore-scripts From 9cc56c63259ea0a30dbb670bd60acd6472c2f76e Mon Sep 17 00:00:00 2001 From: Florian Ludot Date: Wed, 21 Sep 2022 21:42:28 +0900 Subject: [PATCH 5/5] chore: add publish workflow --- .github/workflows/publish.yml | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..94021c5 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,39 @@ +name: 'publish' +on: + release: + types: [created] + + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: 'Setup Node' + uses: actions/setup-node@v2 + with: + node-version: '14.x' + registry-url: 'https://registry.npmjs.org' + - name: 'Install dependencies, audit, build, lint and test' + run: | + npm ci --ignore-scripts + npm run all + - name: 'Publish package on NPM' + run: | + npm publish --access=public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: 'Get message' + id: 'deploy-message' + run: | + echo "::set-output name=commit_msg::$(git log -1 --format=%B)" + echo "::set-output name=commit_sha::$(git log -1 --format=%H)" + - name: 'Slack Notification' + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: ${{ job.status }} + SLACK_ICON: https://raw.githubusercontent.com/florianldt/jerome/master/media/slack-icon.jpg + SLACK_USERNAME: Alf + SLACK_MESSAGE: ${{ steps.deploy-message.outputs.commit_msg }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}