From 1d1543ecd1627213c2b9ce1680f2aeed5bbfc59e Mon Sep 17 00:00:00 2001 From: Siddharth VP Date: Thu, 14 Jan 2021 19:23:36 +0530 Subject: [PATCH] Add github workflows --- .github/workflows/npm-publish.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/unit-tests.yml | 19 +++++++++++++++++++ package.json | 2 +- 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/npm-publish.yml create mode 100644 .github/workflows/unit-tests.yml diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..d633c69 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,30 @@ +name: NPM publish + +on: + release: + types: [created] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm ci + - run: npm test + + publish-npm: + needs: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 0000000..394f4e0 --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,19 @@ +name: Unit tests + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: npm test diff --git a/package.json b/package.json index c49d842..ac37056 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orange-i18n", - "version": "1.0.0", + "version": "1.1.0", "description": "Banana Internationalization library", "main": "dist/banana-i18n.js", "type": "module",