ci(release-please): Prune npm-shrinkwrap before publishing #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release-please | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
pull-request: | |
runs-on: ubuntu-22.04 | |
outputs: | |
releases_created: ${{steps.release.outputs.releases_created}} | |
paths_released: ${{steps.release.outputs.paths_released}} | |
steps: | |
- uses: google-github-actions/release-please-action@v4 | |
id: release | |
with: | |
token: ${{secrets.GH_OPENUI5BOT}} | |
publish-package: | |
needs: pull-request | |
if: ${{needs.pull-request.outputs.releases_created && toJson(fromJson(needs.pull-request.outputs.paths_released)) != '[]'}} | |
runs-on: ubuntu-22.04 | |
permissions: | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use Node.js 21.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 21.x | |
- name: Install dependencies | |
run: npm ci | |
- name: Run build | |
run: npm run build | |
- name: Pruning devDependencies | |
run: npm prune --production | |
- name: Updating npm-shrinkwrap.json | |
run: npm shrinkwrap | |
- name: Publish to NPM | |
env: | |
NPM_TOKEN: ${{secrets.NPM_UI5BOT}} | |
run: | | |
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> ./.npmrc | |
npm publish --provenance --access public |