From 11a5869cf9ed19b0434d313b0ab3fa343ece83fb Mon Sep 17 00:00:00 2001 From: Sahin Vardar Date: Sun, 16 Apr 2023 13:33:41 +0200 Subject: [PATCH] feat: npm publish workflow --- .github/workflows/npm-publish.yml | 33 +++++++++++++++++++++++++++++++ .npmignore | 4 ++++ README.md | 2 +- package-lock.json | 7 ------- 4 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/npm-publish.yml create mode 100644 .npmignore diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..4bcb911 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,33 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages + +name: Publish to NPM + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: npm ci + - run: npm test + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..7b87bf6 --- /dev/null +++ b/.npmignore @@ -0,0 +1,4 @@ +src +.github +jest.config.js +tsconfig.json \ No newline at end of file diff --git a/README.md b/README.md index 85a2af1..388be54 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # Cookies -Cookies is a light weight browser cookie handling library. \ No newline at end of file +Cookies is a light weight browser cookie handling library, with zero dependencies. \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 6c4f091..86eb266 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,6 @@ "@types/jest": "^29.5.0", "@types/jsdom": "^20.0.1", "@types/randombytes": "^2.0.0", - "@types/uuid": "^9.0.0", "jest": "^29.3.1", "jsdom": "^20.0.3", "randombytes": "^2.1.0", @@ -1110,12 +1109,6 @@ "integrity": "sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==", "dev": true }, - "node_modules/@types/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-rFT3ak0/2trgvp4yYZo5iKFEPsET7vKydKF+VRCxlQ9bpheehyAJH89dAkaLEq/j/RZXJIqcgsmPJKUP1Z28HA==", - "dev": true - }, "node_modules/@types/yargs": { "version": "17.0.24", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz",