From 587fc8280abd5a5f3feb753cc8109727fb18ad2c Mon Sep 17 00:00:00 2001 From: gxz Date: Thu, 19 Oct 2023 11:20:06 +0800 Subject: [PATCH] chore: ci --- .github/workflows/publish.yml | 21 +++++++++++++++------ package.json | 5 +++-- scripts/build-finished.ts | 2 +- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f1eba4f..0f54df5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,11 +2,6 @@ name: Release and Publish on: workflow_dispatch: - inputs: - publish-npm: - description: "choose true if want publish to npm" - default: false - type: boolean jobs: release-it: @@ -19,6 +14,13 @@ jobs: fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/setup-node@v3 + with: + node-version: "16.x" + registry-url: "https://npm.pkg.github.com" + # Defaults to the user or organization that owns the workflow file + scope: "@agoraio-extensions" + - name: Setup uses: ./.github/actions/setup @@ -31,6 +33,13 @@ jobs: pnpm build tar -czvf agora-rtc-sdk-ng-fake.tar.gz dist + - name: publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + pnpm publish + working-directory: dist + - name: Upload Artifact ⬆️ uses: actions/upload-artifact@v3 with: @@ -59,4 +68,4 @@ jobs: - name: Release and Publish run: | - pnpm release ${{ steps.package-info.outputs.version }} --ci --npm.publish=${{ inputs.publish-npm }} --github.assets=agora-rtc-sdk-ng-fake.tar.gz + pnpm release ${{ steps.package-info.outputs.version }} --ci --github.assets=agora-rtc-sdk-ng-fake.tar.gz diff --git a/package.json b/package.json index 0f4f6de..aa078fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "agora-rtc-sdk-ng-fake", - "version": "1.0.2", + "name": "@agoraio-extensions/agora-rtc-sdk-ng-fake", + "version": "1.0.3", "private": true, "description": "Fake Agora Web RTC for testing", "repository": { @@ -109,6 +109,7 @@ "before:init": "git fetch --prune --prune-tags origin" }, "npm": { + "publish": false, "allowSameVersion": true }, "github": { diff --git a/scripts/build-finished.ts b/scripts/build-finished.ts index 8f102b1..7cd761d 100644 --- a/scripts/build-finished.ts +++ b/scripts/build-finished.ts @@ -7,7 +7,7 @@ const distDir = "dist"; const packageData = { name: "agora-rtc-sdk-ng-fake", - version: "1.0.0", + version: `${pkg.version}`, description: "Fake Agora Web RTC for testing", main: `${pkg.name}_${pkg.version}.js`, };