From ab919d77bb33866f9fcadb35eb7a4822edc1a9a9 Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Fri, 8 Sep 2023 14:55:28 +0200 Subject: [PATCH] chore: prepare CI --- .github/workflows/main.yml | 34 ++++++++++++++++++++++++++++++++++ LICENSE | 21 +++++++++++++++++++++ package.json | 5 ++++- 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/main.yml create mode 100644 LICENSE diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..73cb892 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,34 @@ +# GitHub Actions docs +# https://help.github.com/en/articles/about-github-actions +# https://help.github.com/en/articles/workflow-syntax-for-github-actions +name: CI + +on: [push] + +jobs: + build: + # Machine environment: + # https://help.github.com/en/articles/software-in-virtual-environments-for-github-actions#ubuntu-1804-lts + # We specify the Node.js version manually below, and use versioned Chrome from Puppeteer. + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 18.10.0 + uses: actions/setup-node@v3 + with: + node-version: 18.10.0 + - name: Install dependencies + run: yarn --frozen-lockfile --non-interactive --no-progress + - name: Format check + run: yarn prettier:check + - name: Build Lib + run: yarn lib:build:prod + - name: Copy built README & LICENCE into dist + run: cp README.md LICENSE dist/ngx-grpc-interceptor + - name: Release + if: contains('refs/heads/master', github.ref) + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npx semantic-release diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..54a1f2a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2019 CloudNC Ltd + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/package.json b/package.json index c399de2..7672b47 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,10 @@ "prettier": "prettier", "prettier:base": "yarn run prettier \"**/*.{js,json,scss,md,ts,html,component.html}\"", "prettier:write": "yarn run prettier:base --write", - "prettier:check": "yarn run prettier:base --list-different" + "prettier:check": "yarn run prettier:base --list-different", + "lib:build:prod": "yarn run ng build --project ngx-grpc-interceptor --configuration production", + "lib:build:watch": "yarn run lib:build:prod --watch", + "lib:test:watch": "yarn run ng test --project ngx-grpc-interceptor" }, "private": true, "dependencies": {