Skip to content

Commit

Permalink
fix: changeset actions
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche committed Jun 9, 2024
1 parent de38e53 commit 70c89fb
Showing 1 changed file with 26 additions and 24 deletions.
50 changes: 26 additions & 24 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
name: Changesets
name: Release

on:
push:
branches:
- main
env:
CI: true
PNPM_CACHE_FOLDER: .pnpm-store

permissions: {}
jobs:
version:
timeout-minutes: 15
release:
permissions:
contents: write # to create release (changesets/action)
pull-requests: write # to create pull request (changesets/action)
name: Release
runs-on: ubuntu-latest
steps:
- name: checkout code repository
uses: actions/checkout@v3
- name: Checkout Repo
uses: actions/checkout@v4
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- name: setup node.js
uses: actions/setup-node@v3
- uses: pnpm/action-setup@v4.0.0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: install pnpm
run: npm i pnpm@8.6.1 -g
- name: Setup npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
- name: setup pnpm config
run: pnpm config set store-dir $PNPM_CACHE_FOLDER
- name: install dependencies
run: pnpm install
- name: create and publish versions
node-version: 22.x
cache: pnpm

- run: pnpm install --frozen-lockfile

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: pnpm ci:version
commit: "chore: update versions"
title: "chore: update versions"
publish: pnpm ci:publish
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: pnpm changeset:release
version: pnpm changeset:version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 70c89fb

Please sign in to comment.