Skip to content

Commit

Permalink
Merge pull request #15 from florianldt/publish
Browse files Browse the repository at this point in the history
Publish
  • Loading branch information
florianldt authored Sep 21, 2022
2 parents f3e2ac8 + 9cc56c6 commit 3a113fa
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 6 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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 }}
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{
"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",
"build": "npm run prebuild && tsc",
"build": "tsc",
"format": "prettier --write '**/*.ts'",
"lint": "eslint .",
"prepare": "husky install",
Expand All @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit 3a113fa

Please sign in to comment.