Skip to content

Commit

Permalink
refactor: Adopt changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
sixmen committed Dec 20, 2024
1 parent f0eb5cb commit 47d68d0
Show file tree
Hide file tree
Showing 6 changed files with 1,764 additions and 78 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
5 changes: 5 additions & 0 deletions .changeset/beige-dots-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'korean-business-day': minor
---

Adopt changesets
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.5/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
46 changes: 16 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
name: release

on:
workflow_dispatch:
inputs:
version:
description: major/minor/patch
required: true
default: minor
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest

steps:
Expand All @@ -20,31 +18,19 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
node-version: '22'
cache: npm

- name: Install packages
run: npm ci

- name: Check test pass before releasing
run: npm test
run: npm install

- name: Add release commit
run: |
git config --global user.name 'croquiscom-admin'
git config --global user.email 'admin@croquis.com'
npm version --no-git-tag-version ${{ github.event.inputs.version }}
npm run build
git add package.json package-lock.json lib
AUTHOR="${{ github.event.sender.login }} <${{ github.event.sender.id }}+${{ github.event.sender.login }}@users.noreply.github.com>"
VERSION=$(node -p "require('./package.json').version")
git commit -m "v$VERSION" --author "$AUTHOR"
git tag v$VERSION
git push
git push --tags
- name: Release version
run: npm publish
- name: Create Release Pull Request or Publish to npm
uses: changesets/action@v1
with:
version: npm run changeset version
publish: npm run release
title: 'chore: release x.y.z'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
createGithubReleases: false
Loading

0 comments on commit 47d68d0

Please sign in to comment.