Skip to content

Commit 0dfc8fa

Browse files
committed
chore: auto publish
1 parent 8618ea0 commit 0dfc8fa

File tree

2 files changed

+17
-30
lines changed

2 files changed

+17
-30
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ jobs:
182182
RELEASE_COMMENT_ID: ${{ needs.release.outputs.comment-id }}
183183
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
184184
run: |
185-
npm exec --offline -- template-oss-release-manager --lockfile=false --publish=false
185+
npm exec --offline -- template-oss-release-manager --lockfile=false --publish=true
186186
npm run rp-pull-request --ignore-scripts --if-present
187187
- name: Commit
188188
id: commit
@@ -331,40 +331,26 @@ jobs:
331331
defaults:
332332
run:
333333
shell: bash
334+
permissions:
335+
deployments: write
336+
id-token: write
334337
steps:
338+
- name: Checkout
339+
uses: actions/checkout@v3
340+
with:
341+
ref: ${{ fromJSON(needs.release.outputs.release).tagName }}
335342
- name: Setup Node
336343
uses: actions/setup-node@v3
337-
id: node
338344
with:
339-
node-version: 20.x
340-
check-latest: contains('20.x', '.x')
341-
342-
- name: View in Registry
345+
node-version: 18.x
346+
- name: Install npm@latest
343347
run: |
344-
EXIT_CODE=0
345-
346-
function is_published {
347-
if npm view "$@" --loglevel=error > /dev/null; then
348-
echo 0
349-
else
350-
echo 1
351-
fi
352-
}
353-
354-
for release in $(echo '${{ needs.release.outputs.releases }}' | jq -r '.[] | @base64'); do
355-
name=$(echo "$release" | base64 --decode | jq -r .pkgName)
356-
version=$(echo "$release" | base64 --decode | jq -r .version)
357-
spec="$name@$version"
358-
status=$(is_published "$spec")
359-
if [[ "$status" -eq 1 ]]; then
360-
echo "$spec ERROR"
361-
EXIT_CODE=$status
362-
else
363-
echo "$spec OK"
364-
fi
365-
done
366-
367-
exit $EXIT_CODE
348+
npm i --prefer-online --no-fund --no-audit -g npm@latest
349+
npm config set '//registry.npmjs.org/:_authToken'=\${PUBLISH_TOKEN}
350+
- name: Publish
351+
env:
352+
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
353+
run: npm publish --provenance --tag=next-6
368354

369355
post-release-integration:
370356
needs: [ release, release-integration ]

scripts/template-oss/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module.exports = {
1515
oldNode: OLD_NODE,
1616
ciVersions: [OLD_NODE],
1717
backport: 6,
18+
publish: true,
1819
allowPaths: [
1920
'/range.bnf',
2021
'/semver.js',

0 commit comments

Comments
 (0)