Skip to content

Commit

Permalink
chore: auto publish
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Sep 15, 2023
1 parent 8618ea0 commit 0dfc8fa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 30 deletions.
46 changes: 16 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ jobs:
RELEASE_COMMENT_ID: ${{ needs.release.outputs.comment-id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm exec --offline -- template-oss-release-manager --lockfile=false --publish=false
npm exec --offline -- template-oss-release-manager --lockfile=false --publish=true
npm run rp-pull-request --ignore-scripts --if-present
- name: Commit
id: commit
Expand Down Expand Up @@ -331,40 +331,26 @@ jobs:
defaults:
run:
shell: bash
permissions:
deployments: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ fromJSON(needs.release.outputs.release).tagName }}
- name: Setup Node
uses: actions/setup-node@v3
id: node
with:
node-version: 20.x
check-latest: contains('20.x', '.x')

- name: View in Registry
node-version: 18.x
- name: Install npm@latest
run: |
EXIT_CODE=0
function is_published {
if npm view "$@" --loglevel=error > /dev/null; then
echo 0
else
echo 1
fi
}
for release in $(echo '${{ needs.release.outputs.releases }}' | jq -r '.[] | @base64'); do
name=$(echo "$release" | base64 --decode | jq -r .pkgName)
version=$(echo "$release" | base64 --decode | jq -r .version)
spec="$name@$version"
status=$(is_published "$spec")
if [[ "$status" -eq 1 ]]; then
echo "$spec ERROR"
EXIT_CODE=$status
else
echo "$spec OK"
fi
done
exit $EXIT_CODE
npm i --prefer-online --no-fund --no-audit -g npm@latest
npm config set '//registry.npmjs.org/:_authToken'=\${PUBLISH_TOKEN}
- name: Publish
env:
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
run: npm publish --provenance --tag=next-6

post-release-integration:
needs: [ release, release-integration ]
Expand Down
1 change: 1 addition & 0 deletions scripts/template-oss/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = {
oldNode: OLD_NODE,
ciVersions: [OLD_NODE],
backport: 6,
publish: true,
allowPaths: [
'/range.bnf',
'/semver.js',
Expand Down

0 comments on commit 0dfc8fa

Please sign in to comment.