From 151593a1d2564976649a7588b252d563f0e3fa17 Mon Sep 17 00:00:00 2001 From: Revone Date: Tue, 26 Sep 2023 20:21:20 +0800 Subject: [PATCH] [pkg] ci to publish --- .github/workflows/release-package.yml | 33 +++++++++++++++++++++++++++ .npmrc | 1 + package.json | 4 ++-- 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release-package.yml create mode 100644 .npmrc diff --git a/.github/workflows/release-package.yml b/.github/workflows/release-package.yml new file mode 100644 index 0000000..5418874 --- /dev/null +++ b/.github/workflows/release-package.yml @@ -0,0 +1,33 @@ +name: data-structure-typed + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: 19 + - run: npm ci + - run: npm test + + publish-gpr: + needs: build + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: 19 + registry-url: https://npm.pkg.github.com/ + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..ccbbf1d --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +@zrwusa:registry=https://npm.pkg.github.com diff --git a/package.json b/package.json index 9adb417..ad4b3a4 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "changelog": "auto-changelog", "coverage:badge": "istanbul-badges-readme", "package": "npm run lint && npm run test && npm run build && npm run build:docs && npm run changelog", - "deploy": "npm publish" + "ci": "npm run package" }, "repository": { "type": "git", @@ -37,7 +37,7 @@ "author": "Tyler Zeng zrwusa@gmail.com", "license": "MIT", "publishConfig": { - "registry": "https://npm.pkg.github.com/" + "@zrwusa:registry": "https://npm.pkg.github.com" }, "bugs": { "url": "https://github.com/zrwusa/data-structure-typed/issues"