Skip to content

Commit

Permalink
chore: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
guoxianzhe committed Oct 19, 2023
1 parent 171f655 commit 587fc82
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand All @@ -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:
Expand Down Expand Up @@ -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
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down Expand Up @@ -109,6 +109,7 @@
"before:init": "git fetch --prune --prune-tags origin"
},
"npm": {
"publish": false,
"allowSameVersion": true
},
"github": {
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-finished.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
};
Expand Down

0 comments on commit 587fc82

Please sign in to comment.