Skip to content

docs: usage

docs: usage #15

on:
push:
branches:
- master
workflow_dispatch:
permissions:
contents: write
pull-requests: write
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
# this assumes that you have created a personal access token
# (PAT) and configured it as a GitHub action secret named
# `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
# this is a built-in strategy in release-please, see "Action Inputs"
# for more options
release-type: node
- name: Checkout
if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@v4
- name: Install pnpm
if: ${{ steps.release.outputs.release_created }}
uses: pnpm/action-setup@v4
with:
version: 10
- name: Install Node.js
if: ${{ steps.release.outputs.release_created }}
uses: actions/setup-node@v4
with:
node-version-file: .node-version
registry-url: https://registry.npmjs.org/
cache: pnpm
- name: Restore Cache
if: ${{ steps.release.outputs.release_created }}
id: dependencies-cache
uses: actions/cache@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install Dependencies 🔧
if: ${{ steps.dependencies-cache.outputs.cache-hit != 'true' && steps.release.outputs.release_created }}
run: |
pnpm install
- name: Build ☕️
if: ${{ steps.release.outputs.release_created }}
run: |
pnpm run build
npm publish --access public --registry=https://registry.npmjs.org/
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}