Skip to content

Introduce commitChangesFromRepo (#11) #11

Introduce commitChangesFromRepo (#11)

Introduce commitChangesFromRepo (#11) #11

name: Release & Publish
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
release-and-publish:
runs-on: ubuntu-latest
environment: main
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Use Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20.x
- name: Extract pnpm version and install
run: |
VERSION=$(cat package.json | grep '"packageManager": "pnpm@' | sed 's/.*"pnpm@\([^"]*\)".*/\1/')
npm install -g pnpm@$VERSION
- name: Cache pnpm modules
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v 4.0.2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
- run: pnpm install --frozen-lockfile
- run: pnpm build
- name: Configure PNPM to use token
run:
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> .npmrc
- name: Run Changeset Workflow
uses: changesets/action@aba318e9165b45b7948c60273e0b72fce0a64eb9 # v1.4.7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
with:
publish: pnpm changeset publish
createGithubReleases: true