@@ -1068,12 +1068,6 @@ jobs:
1068
1068
run:
1069
1069
shell: bash
1070
1070
steps:
1071
- - name: Checkout
1072
- uses: actions/checkout@v3
1073
- - name: Setup Git User
1074
- run: |
1075
- git config --global user.email "npm-cli+bot@github.com"
1076
- git config --global user.name "npm CLI robot"
1077
1071
- name: Setup Node
1078
1072
uses: actions/setup-node@v3
1079
1073
with:
@@ -1084,9 +1078,30 @@ jobs:
1084
1078
run: npm -v
1085
1079
- name: View in Registry
1086
1080
run: |
1087
- name=$(cat package.json | jq -r .name)
1088
- version="\${{ fromJSON(needs.release.output.release).version }}"
1089
- npm view \${name}@\${version}
1081
+ EXIT_CODE=0
1082
+
1083
+ function is_published {
1084
+ if npm view "$@" --loglevel=error > /dev/null; then
1085
+ echo 0
1086
+ else
1087
+ echo 1
1088
+ fi
1089
+ }
1090
+
1091
+ for release in $(echo '\${{ needs.release.outputs.releases }}' | jq -r '.[] | @base64'); do
1092
+ name=$(echo "$release" | base64 --decode | jq -r .pkgName)
1093
+ version=$(echo "$release" | base64 --decode | jq -r .version)
1094
+ spec="$name@$version"
1095
+ status=$(is_published "$spec")
1096
+ if [[ "$status" -eq 1 ]]; then
1097
+ echo "$spec ERROR"
1098
+ EXIT_CODE=$status
1099
+ else
1100
+ echo "$spec OK"
1101
+ fi
1102
+ done
1103
+
1104
+ exit $EXIT_CODE
1090
1105
1091
1106
post-release-integration:
1092
1107
needs: [ release, release-integration ]
@@ -1124,11 +1139,18 @@ jobs:
1124
1139
1125
1140
if (updateComment) {
1126
1141
console.log('Found comment to update:', JSON.stringify(updateComment, null, 2))
1142
+ let body = updateComment.body.replace(/Workflow run: :[a-z_]+:/, \`Workflow run: :\${RESULT}:\`)
1143
+ if (RESULT === 'x') {
1144
+ body += \`/n/n:rotating_light:\`
1145
+ body += \` @npm/cli-team: The post-release workflow failed for this release.\`
1146
+ body += \` Manual steps may need to be taken after examining the workflow output\`
1147
+ body += \` from the above workflow run. :rotating_light:\`
1148
+ }
1127
1149
await github.rest.issues.updateComment({
1128
1150
owner,
1129
1151
repo,
1152
+ body,
1130
1153
comment_id: updateComment.id,
1131
- body: updateComment.body.replace(/Workflow run: :[a-z_]+:/, \`Workflow run: :\${RESULT}:\`),
1132
1154
})
1133
1155
} else {
1134
1156
console.log('No matching comments found:', JSON.stringify(comments, null, 2))
@@ -2620,12 +2642,6 @@ jobs:
2620
2642
run:
2621
2643
shell: bash
2622
2644
steps:
2623
- - name: Checkout
2624
- uses: actions/checkout@v3
2625
- - name: Setup Git User
2626
- run: |
2627
- git config --global user.email "npm-cli+bot@github.com"
2628
- git config --global user.name "npm CLI robot"
2629
2645
- name: Setup Node
2630
2646
uses: actions/setup-node@v3
2631
2647
with:
@@ -2636,9 +2652,30 @@ jobs:
2636
2652
run: npm -v
2637
2653
- name: View in Registry
2638
2654
run: |
2639
- name=$(cat package.json | jq -r .name)
2640
- version="\${{ fromJSON(needs.release.output.release).version }}"
2641
- npm view \${name}@\${version}
2655
+ EXIT_CODE=0
2656
+
2657
+ function is_published {
2658
+ if npm view "$@" --loglevel=error > /dev/null; then
2659
+ echo 0
2660
+ else
2661
+ echo 1
2662
+ fi
2663
+ }
2664
+
2665
+ for release in $(echo '\${{ needs.release.outputs.releases }}' | jq -r '.[] | @base64'); do
2666
+ name=$(echo "$release" | base64 --decode | jq -r .pkgName)
2667
+ version=$(echo "$release" | base64 --decode | jq -r .version)
2668
+ spec="$name@$version"
2669
+ status=$(is_published "$spec")
2670
+ if [[ "$status" -eq 1 ]]; then
2671
+ echo "$spec ERROR"
2672
+ EXIT_CODE=$status
2673
+ else
2674
+ echo "$spec OK"
2675
+ fi
2676
+ done
2677
+
2678
+ exit $EXIT_CODE
2642
2679
2643
2680
post-release-integration:
2644
2681
needs: [ release, release-integration ]
@@ -2676,11 +2713,18 @@ jobs:
2676
2713
2677
2714
if (updateComment) {
2678
2715
console.log('Found comment to update:', JSON.stringify(updateComment, null, 2))
2716
+ let body = updateComment.body.replace(/Workflow run: :[a-z_]+:/, \`Workflow run: :\${RESULT}:\`)
2717
+ if (RESULT === 'x') {
2718
+ body += \`/n/n:rotating_light:\`
2719
+ body += \` @npm/cli-team: The post-release workflow failed for this release.\`
2720
+ body += \` Manual steps may need to be taken after examining the workflow output\`
2721
+ body += \` from the above workflow run. :rotating_light:\`
2722
+ }
2679
2723
await github.rest.issues.updateComment({
2680
2724
owner,
2681
2725
repo,
2726
+ body,
2682
2727
comment_id: updateComment.id,
2683
- body: updateComment.body.replace(/Workflow run: :[a-z_]+:/, \`Workflow run: :\${RESULT}:\`),
2684
2728
})
2685
2729
} else {
2686
2730
console.log('No matching comments found:', JSON.stringify(comments, null, 2))
@@ -4015,12 +4059,6 @@ jobs:
4015
4059
run:
4016
4060
shell: bash
4017
4061
steps:
4018
- - name: Checkout
4019
- uses: actions/checkout@v3
4020
- - name: Setup Git User
4021
- run: |
4022
- git config --global user.email "npm-cli+bot@github.com"
4023
- git config --global user.name "npm CLI robot"
4024
4062
- name: Setup Node
4025
4063
uses: actions/setup-node@v3
4026
4064
with:
@@ -4031,9 +4069,30 @@ jobs:
4031
4069
run: npm -v
4032
4070
- name: View in Registry
4033
4071
run: |
4034
- name=$(cat package.json | jq -r .name)
4035
- version="\${{ fromJSON(needs.release.output.release).version }}"
4036
- npm view \${name}@\${version}
4072
+ EXIT_CODE=0
4073
+
4074
+ function is_published {
4075
+ if npm view "$@" --loglevel=error > /dev/null; then
4076
+ echo 0
4077
+ else
4078
+ echo 1
4079
+ fi
4080
+ }
4081
+
4082
+ for release in $(echo '\${{ needs.release.outputs.releases }}' | jq -r '.[] | @base64'); do
4083
+ name=$(echo "$release" | base64 --decode | jq -r .pkgName)
4084
+ version=$(echo "$release" | base64 --decode | jq -r .version)
4085
+ spec="$name@$version"
4086
+ status=$(is_published "$spec")
4087
+ if [[ "$status" -eq 1 ]]; then
4088
+ echo "$spec ERROR"
4089
+ EXIT_CODE=$status
4090
+ else
4091
+ echo "$spec OK"
4092
+ fi
4093
+ done
4094
+
4095
+ exit $EXIT_CODE
4037
4096
4038
4097
post-release-integration:
4039
4098
needs: [ release, release-integration ]
@@ -4071,11 +4130,18 @@ jobs:
4071
4130
4072
4131
if (updateComment) {
4073
4132
console.log('Found comment to update:', JSON.stringify(updateComment, null, 2))
4133
+ let body = updateComment.body.replace(/Workflow run: :[a-z_]+:/, \`Workflow run: :\${RESULT}:\`)
4134
+ if (RESULT === 'x') {
4135
+ body += \`/n/n:rotating_light:\`
4136
+ body += \` @npm/cli-team: The post-release workflow failed for this release.\`
4137
+ body += \` Manual steps may need to be taken after examining the workflow output\`
4138
+ body += \` from the above workflow run. :rotating_light:\`
4139
+ }
4074
4140
await github.rest.issues.updateComment({
4075
4141
owner,
4076
4142
repo,
4143
+ body,
4077
4144
comment_id: updateComment.id,
4078
- body: updateComment.body.replace(/Workflow run: :[a-z_]+:/, \`Workflow run: :\${RESULT}:\`),
4079
4145
})
4080
4146
} else {
4081
4147
console.log('No matching comments found:', JSON.stringify(comments, null, 2))
0 commit comments