From 40234fe3cf7b27c2410b495488aa9f3bab569498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Sun, 26 Feb 2023 22:02:47 +0100 Subject: [PATCH] Add NPM CI (#25) * update CI. * update readme. --- .github/workflows/publish.yml | 31 ------------ .github/workflows/tags.yml | 91 +++++++++++++++++++++++++++++++++++ README.md | 10 +--- 3 files changed, 92 insertions(+), 40 deletions(-) delete mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/tags.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 2eae80e8..00000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Publish to npm.pkg.github.com - -on: - push: - tags: - - 'v*' - -jobs: - build-and-publish: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version: '16.x' - registry-url: 'https://npm.pkg.github.com' - - - name: Install dependencies and build - run: npm install && npm run build - - - name: Publish package to npm.pkg.github.com - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/tags.yml b/.github/workflows/tags.yml new file mode 100644 index 00000000..c1c03c84 --- /dev/null +++ b/.github/workflows/tags.yml @@ -0,0 +1,91 @@ +name: Build and Publish package on tags + +on: + push: + tags: + - 'v*' + +env: + NODE_VERSION: '16.x' + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '16.x' + registry-url: 'https://npm.pkg.github.com' + + - name: Install dependencies and build + run: npm ci && npm run build + + - name: Prepare Artifact + run: | + mkdir artifact + cp LICENSE README.md package.json artifact + cp -r dist artifact/dist + + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: package + path: artifact + + publish-to-npm-pkg-github-com: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + needs: [ build ] + + steps: + - name: Download Artifact + uses: actions/download-artifact@v2 + with: + name: package + + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: ${{ env.NODE_VERSION }} + registry-url: 'https://npm.pkg.github.com' + + - name: Publish package to npm.pkg.github.com + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + publish-to-registry-npmjs-org: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + needs: [ build ] + + steps: + - name: Download Artifact + uses: actions/download-artifact@v2 + with: + name: package + + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: ${{ env.NODE_VERSION }} + registry-url: 'https://registry.npmjs.org' + + - name: Publish package to registry.npmjs.org + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} diff --git a/README.md b/README.md index ec637346..609070e6 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Connect to [demodesk/neko](https://github.com/demodesk/neko) backend with self c For **community edition** neko with GUI and _plug & play_ deployment visit [m1k1o/neko](https://github.com/m1k1o/neko). ## Installation -Code is published to public GitHub npm repository. +Code is published to public NPM registry and GitHub npm repository. ```bash # npm command @@ -13,14 +13,6 @@ npm i @demodesk/neko yarn add @demodesk/neko ``` -### Registry setup - -```bash -# npm command -echo @demodesk:registry=https://npm.pkg.github.com >> .npmrc -# yarn command -echo \"@demodesk:registry\" \"https://npm.pkg.github.com\" >> .yarnrc -``` ### Build You can set keyboard provider at build time, either `novnc` or the default `guacamole`.