Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev/publich to GitHub packages #9

Merged
merged 10 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 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,8 +14,17 @@ jobs:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup
uses: ./.github/actions/setup
- uses: pnpm/[email protected]
with:
version: latest

- uses: actions/setup-node@v3
with:
node-version: "16.x"
cache: "pnpm"
registry-url: "https://npm.pkg.github.com"
# Defaults to the user or organization that owns the workflow file
scope: "@agoraio-extensions"

- name: Setup Dependencies 💚
run: |
Expand All @@ -31,6 +35,13 @@ jobs:
pnpm build
tar -czvf agora-rtc-sdk-ng-fake.tar.gz dist

- name: publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd dist
npm publish --no-git-checks

- name: Upload Artifact ⬆️
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -59,4 +70,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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# agora-rtc-sdk-ng-fake

## [1.0.4](https://github.com/AgoraIO-Extensions/agora-rtc-sdk-ng-fake/compare/v1.0.2...v1.0.4) (2023-10-19)

## 1.0.2 (2023-10-19)

### Features
Expand Down
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.4",
"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
7 changes: 5 additions & 2 deletions scripts/build-finished.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ const pkg = require("../package.json");
const distDir = "dist";

const packageData = {
name: "agora-rtc-sdk-ng-fake",
version: "1.0.0",
name: `${pkg.name}`,
version: `${pkg.version}`,
description: "Fake Agora Web RTC for testing",
main: `${pkg.name}_${pkg.version}.js`,
publishConfig: {
registry: "https://npm.pkg.github.com",
},
};

const packagePath = path.join(distDir, "package.json");
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = "1.0.2";
export const VERSION = "1.0.4";