Skip to content

Commit 586e94b

Browse files
authored
chore: optimize release workflow (#4057)
1 parent 81d00e1 commit 586e94b

File tree

36 files changed

+58
-48
lines changed

36 files changed

+58
-48
lines changed

.github/workflows/preview.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
name: Preview Release
33

44
on:
5-
push:
6-
branches: [main]
75
workflow_dispatch:
6+
inputs:
7+
branch:
8+
description: 'Release preview version branch (confirm release branch)'
9+
required: true
10+
default: 'main'
811

912
permissions:
1013
contents: read
@@ -19,6 +22,14 @@ jobs:
1922
uses: actions/checkout@v4
2023
with:
2124
fetch-depth: 25
25+
ref: ${{ github.event.inputs.branch }}
26+
27+
# Use corepack to install pnpm
28+
- name: Setup Pnpm
29+
run: |
30+
npm install -g corepack@latest --force
31+
corepack prepare [email protected] --activate
32+
corepack enable
2233
2334
- name: Setup Node.js
2435
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
@@ -27,14 +38,10 @@ jobs:
2738
cache: 'pnpm'
2839

2940
# Update npm to the latest version to enable OIDC
30-
# Use corepack to install pnpm
31-
- name: Setup Package Managers
41+
- name: Update npm
3242
run: |
3343
npm install -g npm@latest
3444
npm --version
35-
npm install -g corepack@latest --force
36-
corepack prepare [email protected] --activate
37-
corepack enable
3845
3946
- name: Install deps
4047
run: pnpm install
@@ -47,5 +54,4 @@ jobs:
4754
4855
- name: Publish Preview
4956
run: |
50-
51-
pkg-pr-new publish --compact --pnpm ./packages/*
57+
pnpx [email protected] publish --compact --pnpm ./packages/*

.github/workflows/release.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ jobs:
3131
uses: actions/checkout@v4
3232
with:
3333
fetch-depth: 25
34+
ref: ${{ github.event.inputs.branch }}
35+
36+
# Use corepack to install pnpm
37+
- name: Setup Pnpm
38+
run: |
39+
npm install -g corepack@latest --force
40+
corepack prepare [email protected] --activate
41+
corepack enable
3442
3543
- name: Setup Node.js
3644
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
@@ -39,14 +47,10 @@ jobs:
3947
cache: 'pnpm'
4048

4149
# Update npm to the latest version to enable OIDC
42-
# Use corepack to install pnpm
43-
- name: Setup Package Managers
50+
- name: Update npm
4451
run: |
4552
npm install -g npm@latest
4653
npm --version
47-
npm install -g corepack@latest --force
48-
corepack prepare [email protected] --activate
49-
corepack enable
5054
5155
- name: Install deps
5256
run: pnpm install

packages/assemble-release-plan/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"license": "MIT",
3333
"repository": {
3434
"type": "git",
35-
"url": "https://github.com/module-federation/core/",
35+
"url": "git+https://github.com/module-federation/core.git",
3636
"directory": "packages/assemble-release-plan"
3737
},
3838
"dependencies": {

packages/bridge/bridge-react-webpack-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"license": "MIT",
99
"repository": {
1010
"type": "git",
11-
"url": "https://github.com/module-federation/core",
11+
"url": "git+https://github.com/module-federation/core.git",
1212
"directory": "packages/bridge-react-webpack-plugin"
1313
},
1414
"main": "./dist/index.cjs.js",

packages/bridge/bridge-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"license": "MIT",
1010
"repository": {
1111
"type": "git",
12-
"url": "https://github.com/module-federation/core",
12+
"url": "git+https://github.com/module-federation/core.git",
1313
"directory": "packages/bridge-react"
1414
},
1515
"main": "./dist/index.cjs.js",

packages/bridge/bridge-shared/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"license": "MIT",
99
"repository": {
1010
"type": "git",
11-
"url": "https://github.com/module-federation/core",
11+
"url": "git+https://github.com/module-federation/core.git",
1212
"directory": "packages/bridge-shared"
1313
},
1414
"type": "module",

packages/bridge/vue3-bridge/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "MIT",
55
"repository": {
66
"type": "git",
7-
"url": "https://github.com/module-federation/core",
7+
"url": "git+https://github.com/module-federation/core.git",
88
"directory": "packages/vue3-bridge"
99
},
1010
"version": "0.18.4",

packages/chrome-devtools/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "MIT",
55
"repository": {
66
"type": "git",
7-
"url": "https://github.com/module-federation/core",
7+
"url": "git+https://github.com/module-federation/core.git",
88
"directory": "packages/chrome-devtools"
99
},
1010
"scripts": {

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"repository": {
1111
"type": "git",
12-
"url": "https://github.com/module-federation/core",
12+
"url": "git+https://github.com/module-federation/core.git",
1313
"directory": "packages/cli"
1414
},
1515
"bin": {

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"repository": {
1717
"type": "git",
18-
"url": "https://github.com/module-federation/core/",
18+
"url": "git+https://github.com/module-federation/core.git",
1919
"directory": "tree/main/packages/core"
2020
},
2121
"peerDependencies": {

0 commit comments

Comments
 (0)