Skip to content

Commit 50fe993

Browse files
author
niuweili
committed
add ali-oss deploy
1 parent 4d5533f commit 50fe993

20 files changed

Lines changed: 1007 additions & 120 deletions

File tree

.github/workflows/deploy-auto.yml

Lines changed: 27 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'v*' # 当推送带有 v 前缀的标签时触发
77

88
jobs:
9-
pre-notify:
9+
deploy-prod:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout code
@@ -17,26 +17,35 @@ jobs:
1717
with:
1818
node-version: '18'
1919

20-
- name: Prepare notification
20+
- name: Install dependencies
21+
run: yarn
22+
23+
- name: Export BUILD_MODE
24+
run: export BUILD_MODE=release
25+
26+
- name: Get version
2127
run: |
22-
COMMIT_MESSAGE=$(git show-branch --no-name HEAD)
23-
echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" >> $GITHUB_ENV
24-
echo "BUILD_URL=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> $GITHUB_ENV
25-
echo "COMMIT_URL=https://github.com/${{ github.repository }}/commit/${{ github.sha }}" >> $GITHUB_ENV
28+
FULL_VERSION=$(node -p -e "require('./lerna.json').version")
29+
MAJOR_VERSION=$(echo $FULL_VERSION | cut -d. -f1)
30+
echo "VERSION=$MAJOR_VERSION" >> $GITHUB_ENV
31+
echo "version=$MAJOR_VERSION" >> $GITHUB_OUTPUT
32+
env:
33+
BUILD_MODE: release
2634

27-
- name: Notify deployment ready
28-
if: success()
29-
uses: slackapi/slack-github-action@v1.25.0
30-
with:
31-
channel-id: 'rum'
32-
payload: |
33-
{
34-
"text": ":i: ${{ github.repository }} <${{ env.BUILD_URL }}|${{ env.COMMIT_MESSAGE }}> ready to be deployed *automatically* to :flashcatcloud:"
35-
}
35+
- name: Build bundle
36+
run: yarn build:bundle
37+
38+
- name: Deploy to prod
39+
run: node ./scripts/deploy/deploy-oss.js prod v${VERSION}
3640
env:
37-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
41+
OSS_ENDPOINT: ${{ secrets.OSS_ENDPOINT }}
42+
OSS_REGION: ${{ secrets.OSS_REGION }}
43+
OSS_ACCESS_KEY: ${{ secrets.OSS_ACCESS_KEY }}
44+
OSS_BUCKET: ${{ secrets.OSS_BUCKET }}
45+
OSS_SECRET_KEY: ${{ secrets.OSS_SECRET_KEY }}
3846

3947
publish-npm:
48+
needs: deploy-prod
4049
runs-on: ubuntu-latest
4150
steps:
4251
- name: Checkout code
@@ -56,30 +65,8 @@ jobs:
5665
env:
5766
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5867

59-
# publish-developer-extension:
60-
# needs: publish-npm
61-
# runs-on: ubuntu-latest
62-
# steps:
63-
# - name: Checkout code
64-
# uses: actions/checkout@v4
65-
66-
# - name: Setup Node.js
67-
# uses: actions/setup-node@v4
68-
# with:
69-
# node-version: '18'
70-
71-
# - name: Install dependencies
72-
# run: yarn
73-
74-
# - name: Publish developer extension
75-
# run: node ./scripts/deploy/publish-developer-extension.js
76-
# env:
77-
# CHROME_EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }}
78-
# CHROME_CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
79-
# CHROME_CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
80-
# CHROME_REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
81-
8268
post-notify-success:
69+
needs: publish-npm
8370
runs-on: ubuntu-latest
8471
if: success()
8572
steps:
@@ -103,18 +90,8 @@ jobs:
10390
env:
10491
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
10592

106-
# - name: Notify ops team
107-
# uses: slackapi/slack-github-action@v1.25.0
108-
# with:
109-
# channel-id: 'rum-browser-sdk-ops'
110-
# payload: |
111-
# {
112-
# "text": ":rocket: ${{ github.repository }} <${{ env.COMMIT_URL }}|${{ env.COMMIT_MESSAGE }}> *automatically* deployed to :earth_americas:."
113-
# }
114-
# env:
115-
# SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
116-
11793
post-notify-failure:
94+
needs: publish-npm
11895
runs-on: ubuntu-latest
11996
if: failure()
12097
steps:

.github/workflows/deploy-manual.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -60,29 +60,6 @@ jobs:
6060
env:
6161
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6262

63-
# publish-developer-extension:
64-
# needs: publish-npm
65-
# runs-on: ubuntu-latest
66-
# steps:
67-
# - name: Checkout code
68-
# uses: actions/checkout@v4
69-
70-
# - name: Setup Node.js
71-
# uses: actions/setup-node@v4
72-
# with:
73-
# node-version: '18'
74-
75-
# - name: Install dependencies
76-
# run: yarn
77-
78-
# - name: Publish developer extension
79-
# run: node ./scripts/deploy/publish-developer-extension.js
80-
# env:
81-
# CHROME_EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }}
82-
# CHROME_CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
83-
# CHROME_CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
84-
# CHROME_REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
85-
8663
post-notify-success:
8764
runs-on: ubuntu-latest
8865
if: success()

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ browserstack.err
2121
/playwright-report/
2222
/blob-report/
2323
/playwright/.cache/
24-
.VSCodeCounter
24+
.VSCodeCounter
25+
.env

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818
1919
---
2020

21+
## v0.0.1-alpha.3
22+
23+
**Internal Changes:**
24+
25+
- add ali-oss deploy
26+
- 全局替换window.FC_RUM + window.FC_LOGS [LOGS] [RUM] [RUM-REACT] [RUM-SLIM] [WORKER]
27+
- add workflow
28+
2129
## v0.0.1-alpha.2
2230

2331
**Internal Changes:**

developer-extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@flashcatcloud/browser-sdk-developer-extension",
3-
"version": "0.0.1-alpha.2",
3+
"version": "0.0.1-alpha.3",
44
"private": true,
55
"scripts": {
66
"build": "rm -rf dist && webpack --mode production",

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"npmClient": "yarn",
3-
"version": "0.0.1-alpha.2"
3+
"version": "0.0.1-alpha.3"
44
}

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
"woke": "scripts/cli woke"
3434
},
3535
"devDependencies": {
36+
"@alicloud/cdn20180510": "5.0.0",
37+
"@alicloud/openapi-client": "0.4.13",
3638
"@eslint/js": "9.21.0",
3739
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
3840
"@playwright/test": "1.50.1",
@@ -44,6 +46,7 @@
4446
"@types/jasmine": "3.10.18",
4547
"@types/node": "22.13.9",
4648
"ajv": "8.17.1",
49+
"ali-oss": "6.22.0",
4750
"browserstack-local": "1.5.6",
4851
"chrome-webstore-upload": "3.1.4",
4952
"connect-busboy": "1.0.0",

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@flashcatcloud/browser-core",
3-
"version": "0.0.1-alpha.2",
3+
"version": "0.0.1-alpha.3",
44
"license": "Apache-2.0",
55
"main": "cjs/index.js",
66
"module": "esm/index.js",

packages/logs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@flashcatcloud/browser-logs",
3-
"version": "0.0.1-alpha.2",
3+
"version": "0.0.1-alpha.3",
44
"license": "Apache-2.0",
55
"main": "cjs/entries/main.js",
66
"module": "esm/entries/main.js",
@@ -16,7 +16,7 @@
1616
"@flashcatcloud/browser-core": "workspace:*"
1717
},
1818
"peerDependencies": {
19-
"@flashcatcloud/browser-rum": "0.0.1-alpha.2"
19+
"@flashcatcloud/browser-rum": "0.0.1-alpha.3"
2020
},
2121
"peerDependenciesMeta": {
2222
"@flashcatcloud/browser-rum": {

packages/rum-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@flashcatcloud/browser-rum-core",
3-
"version": "0.0.1-alpha.2",
3+
"version": "0.0.1-alpha.3",
44
"license": "Apache-2.0",
55
"main": "cjs/index.js",
66
"module": "esm/index.js",

0 commit comments

Comments
 (0)