Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6f8e24b

Browse files
committed
[ci] Prepare publish workflow
Fixes up a few things
1 parent 227e841 commit 6f8e24b

3 files changed

Lines changed: 47 additions & 12 deletions

File tree

.github/workflows/runtime_releases_from_npm_manual.yml

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ on:
1212
description: Version to publish for the specified packages
1313
type: string
1414
only_packages:
15-
description: Space separated list of packages to publish on NPM. Use this OR skip_packages, not together.
15+
description: Packages to publish (space separated)
1616
type: string
1717
skip_packages:
18-
description: Space separated list of packages to NOT publish on NPM. Use this OR only_packages, not together.
18+
description: Packages to NOT publish (space separated)
1919
type: string
2020
tags:
21-
description: Space separated list of tags to tag the release with on NPM
21+
description: NPM tags (space separated)
2222
type: string
23-
default: "['untagged']"
23+
default: untagged
2424
dry:
2525
required: true
26-
description: Don't actually publish, just run a dry run
26+
description: Dry run instead of publish?
2727
type: boolean
2828
default: true
2929
force_notify:
30-
description: Force a Discord notification
30+
description: Force a Discord notification?
3131
type: boolean
3232
default: false
3333

@@ -52,8 +52,8 @@ jobs:
5252
embed-author-icon-url: ${{ github.event.sender.avatar_url }}
5353
embed-title: '⚠️ Publishing release from NPM'
5454
embed-description: |
55-
```
56-
inputs: ${{ toJson(inputs) }}
55+
```json
56+
${{ toJson(inputs) }}
5757
```
5858
embed-url: https://github.com/facebook/react/actions/runs/${{ github.run_id }}
5959

@@ -81,11 +81,32 @@ jobs:
8181
- run: cp ./scripts/release/ci-npmrc ~/.npmrc
8282
- if: '${{ inputs.only_packages }}'
8383
run: |
84-
scripts/release/prepare-release-from-npm.js --skipTests --version=${{ inputs.version_to_promote }} --onlyPackages=${{ inputs.only_packages }}
84+
scripts/release/prepare-release-from-npm.js \
85+
--skipTests \
86+
--version=${{ inputs.version_to_promote }} \
87+
--onlyPackages=${{ inputs.only_packages }}
88+
8589
ls -R build/node_modules
86-
# scripts/release/publish.js --ci --tags=${{ inputs.tags }} --publishVersion=${{ inputs.version_to_publish }} --onlyPackages=${{ inputs.only_packages }} --dry=${{ inputs.dry || 'false' }}
90+
find build/node_modules -name package.json -exec cat "{}" \;
91+
92+
scripts/release/publish.js \
93+
--ci \
94+
--tags=${{ inputs.tags }} \
95+
--publishVersion=${{ inputs.version_to_publish }} \
96+
--onlyPackages=${{ inputs.only_packages }} \
97+
--dry=${{ inputs.dry }}
8798
- if: '${{ inputs.skip_packages }}'
8899
run: |
89-
scripts/release/prepare-release-from-npm.js --skipTests --version=${{ inputs.version_to_promote }} --skipPackages=${{ inputs.skip_packages }}
100+
scripts/release/prepare-release-from-npm.js \
101+
--skipTests --version=${{ inputs.version_to_promote }} \
102+
--skipPackages=${{ inputs.skip_packages }}
103+
90104
ls -R build/node_modules
91-
# scripts/release/publish.js --ci --tags=${{ inputs.tags }} --publishVersion=${{ inputs.version_to_publish }} --skipPackages=${{ inputs.skip_packages }} --dry=${{ inputs.dry || 'false' }}
105+
find build/node_modules -name package.json -exec cat "{}" \;
106+
107+
scripts/release/publish.js \
108+
--ci \
109+
--tags=${{ inputs.tags }} \
110+
--publishVersion=${{ inputs.version_to_publish }} \
111+
--skipPackages=${{ inputs.skip_packages }} \
112+
--dry=${{ inputs.dry }}

scripts/release/prepare-release-from-npm.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ const run = async () => {
2626
params.version = await getLatestNextVersion();
2727
}
2828

29+
if (params.onlyPackages.length > 0 && params.skipPackages.length > 0) {
30+
console.error(
31+
'--onlyPackages and --skipPackages cannot be used together'
32+
);
33+
process.exit(1);
34+
}
35+
2936
params.packages = await getPublicPackages(isExperimental);
3037
params.packages = params.packages.filter(packageName => {
3138
if (params.onlyPackages.length > 0) {

scripts/release/publish.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ const run = async () => {
3131
params.cwd = join(__dirname, '..', '..');
3232
params.packages = await getPublicPackages(isExperimental);
3333

34+
if (params.onlyPackages.length > 0 && params.skipPackages.length > 0) {
35+
console.error(
36+
'--onlyPackages and --skipPackages cannot be used together'
37+
);
38+
process.exit(1);
39+
}
40+
3441
if (params.onlyPackages.length > 0) {
3542
params.packages = params.packages.filter(packageName => {
3643
return params.onlyPackages.includes(packageName);

0 commit comments

Comments
 (0)