Skip to content

refactor(icons): move withSpin HOC from icons to react package #21

refactor(icons): move withSpin HOC from icons to react package

refactor(icons): move withSpin HOC from icons to react package #21

Workflow file for this run

name: Release
on:
push:
branches: [master]
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
- name: Auto-generate changesets for modified packages
run: |
# Find the latest version tag to diff against
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || git rev-list --max-parents=0 HEAD)
echo "Comparing against: $LAST_TAG"
# Skip if there are already changeset files (manually created)
EXISTING=$(find .changeset -name '*.md' ! -name 'README.md' | head -1)
if [ -n "$EXISTING" ]; then
echo "Changeset files already exist, skipping auto-generation"
exit 0
fi
CHANGED_PACKAGES=""
for pkg_json in packages/*/package.json; do
pkg_dir=$(dirname "$pkg_json")
pkg_name=$(node -p "require('./$pkg_json').name")
# Check if any source files changed in this package
if git diff --quiet "$LAST_TAG" -- "$pkg_dir/src" 2>/dev/null; then
echo "No changes in $pkg_name"
else
echo "Changes detected in $pkg_name"
CHANGED_PACKAGES="$CHANGED_PACKAGES $pkg_name"
fi
done
if [ -z "$CHANGED_PACKAGES" ]; then
echo "No packages changed, skipping changeset generation"
exit 0
fi
# Build the changeset file
RANDOM_ID=$(head -c 8 /dev/urandom | od -An -tx1 | tr -d ' \n')
CHANGESET_FILE=".changeset/auto-${RANDOM_ID}.md"
{
echo "---"
for pkg in $CHANGED_PACKAGES; do
echo "'${pkg}': patch"
done
echo "---"
echo ""
echo "Auto-detected changes since $LAST_TAG"
} > "$CHANGESET_FILE"
echo "Generated $CHANGESET_FILE for:$CHANGED_PACKAGES"
cat "$CHANGESET_FILE"
- name: Version packages
run: |
CHANGESETS=$(find .changeset -name '*.md' ! -name 'README.md' | head -1)
if [ -z "$CHANGESETS" ]; then
echo "No changesets found, skipping"
echo "HAS_CHANGES=false" >> "$GITHUB_ENV"
exit 0
fi
pnpm changeset version
echo "HAS_CHANGES=true" >> "$GITHUB_ENV"
- name: Commit version bump
if: env.HAS_CHANGES == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "chore: version packages [skip ci]"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to npm
if: env.HAS_CHANGES == 'true'
run: pnpm release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}