-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (60 loc) · 2.01 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Release and Publish
on:
workflow_dispatch:
jobs:
release-it:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- uses: pnpm/action-setup@v2.2.4
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: |
pnpm install
- name: Zip It Up 🤐
run: |
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:
name: agora-rtc-sdk-ng-fake.tar.gz
path: agora-rtc-sdk-ng-fake.tar.gz
- name: Setup NPM auth token
if: ${{ inputs.publish-npm }}
run: |
npm set "//registry.npmjs.org/:_authToken" ${{ secrets.NPM_TOKEN }}
- name: Config Git
run: |
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{ github.actor }}"
- name: Get Package Info
id: package-info
run: |
version=$(node -p "require('./package.json').version")
echo "version=${version}" >> "$GITHUB_OUTPUT"
- name: Update VERSION
run: |
pnpm exec esbuild-dev $PWD/scripts/release/update-version.ts @${{ steps.package-info.outputs.version }}
- name: Release and Publish
run: |
pnpm release ${{ steps.package-info.outputs.version }} --ci --github.assets=agora-rtc-sdk-ng-fake.tar.gz