build(deps): bump the npm-dependencies group across 2 directories wit… #257
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
on: | |
workflow_dispatch: # makes it possible to run the workflow manually | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
pull-requests: write | |
name: release | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: googleapis/release-please-action@v4.1.3 | |
id: release | |
with: | |
token: ${{ secrets.RELEASE_PLEASE_ACCESS_TOKEN }} | |
config-file: release-please-config.json | |
manifest-file: .release-please-manifest.json | |
publish-to-npm: | |
runs-on: ubuntu-latest | |
steps: | |
# https://dev.to/receter/automatically-publish-your-node-package-to-npm-with-pnpm-and-github-actions-22eg | |
- name: Checkout | |
uses: actions/checkout@v4.2.2 | |
- uses: pnpm/action-setup@v4.0.0 | |
- name: Install Node.js | |
uses: actions/setup-node@v4.1.0 | |
with: | |
node-version-file: .nvmrc | |
cache: "pnpm" | |
registry-url: https://registry.npmjs.org | |
- run: pnpm install | |
- run: pnpm build | |
- name: Publish 🚀 | |
shell: bash | |
run: | | |
npm_version=$(pnpm show @tui-sandbox/library version) | |
local_version=$(node -p "require('./packages/library/package.json').version") | |
if [ "$npm_version" = "$local_version" ]; then | |
echo "Version $npm_version already published. Skipping publish." | |
exit 0 | |
fi | |
pnpm publish packages/library --access public --no-git-checks | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }} |