Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 9 additions & 36 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,27 @@ on:

jobs:
release:
name: Version & Publish
runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write
id-token: write

steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org/"

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Version packages with Changesets
run: npx changeset version
registry-url: https://registry.npmjs.org/

- name: Commit version bump and changelog
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "chore: version bump"
git push
- run: npm ci
- run: npm run build

- name: Get package version
id: get-version
run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
- name: Create Release Pull Request or Publish
uses: changesets/action@v1
with:
tag_name: v${{ steps.get-version.outputs.VERSION }}
name: v${{ steps.get-version.outputs.VERSION }}
body_path: ./CHANGELOG.md
publish: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to npm
run: npx changeset publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading