Skip to content
Merged
Show file tree
Hide file tree
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
15 changes: 14 additions & 1 deletion .github/workflows/auto-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ permissions:
contents: write
pull-requests: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
changelog:
if: "${{github.event.pull_request.merged == true && !startsWith(github.event.pull_request.title, 'release: v')}}"
Expand Down Expand Up @@ -37,6 +41,12 @@ jobs:
git config --global user.name "GitHub Actions Bot"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

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

- name: Generate changelog and bump version
run: pnpm release --skip.commit --skip.tag

Expand All @@ -51,11 +61,14 @@ jobs:
commit-message: "release: v${{ steps.get-version.outputs.VERSION }}"
title: "release: v${{ steps.get-version.outputs.VERSION }}"
body: |
# Release v${{ steps.get-version.outputs.VERSION }}

이 PR은 자동으로 생성되었습니다.

## 변경 사항
- package.json 버전 업데이트 (${{ steps.get-version.outputs.VERSION }})
- package.json 버전 업데이트 (${{ steps.get-previous-version.outputs.PREVIOUS_VERSION }} -> ${{ steps.get-version.outputs.VERSION }})
- CHANGELOG.md 갱신

branch: auto-changelog-update
base: main
delete-branch: true
15 changes: 13 additions & 2 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
permissions:
contents: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
create-release:
if: "${{github.event.pull_request.merged == true && startsWith(github.event.pull_request.title, 'release: v')}}"
Expand Down Expand Up @@ -43,8 +47,15 @@ jobs:
run: |
# CHANGELOG.md에서 현재 버전의 변경 사항을 추출
VERSION="${{ steps.extract-version.outputs.VERSION }}"
CHANGELOG_CONTENT=$(sed -n "/## \[${VERSION}\]/,/## \[/p" CHANGELOG.md | sed '$d')
# 대괄호가 있는 형식과 없는 형식 모두 처리
CHANGELOG_CONTENT_BODY=$(sed -n -E "/### \[?${VERSION}\]?.*\(/,/### \[?[0-9]+\.[0-9]+\.[0-9]+\]?/p" CHANGELOG.md | sed '$d')
PREVIOUS_VERSION=$(git describe --tags --abbrev=0)
FULL_CHANGELOG_CONTENT=$(echo "**Full Changelog**: https://github.com/99mini/fx/compare/${PREVIOUS_VERSION}...${VERSION}")

echo "Previous version: $PREVIOUS_VERSION"
echo "Full changelog: $FULL_CHANGELOG_CONTENT"

CHANGELOG_CONTENT=$(echo "$CHANGELOG_CONTENT_BODY\n\n$FULL_CHANGELOG_CONTENT")
echo "CHANGELOG_CONTENT<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG_CONTENT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -86,6 +97,6 @@ jobs:
run: pnpm install

- name: Publish npm package
run: pnpm publish --no-git-checks
run: pnpm npm publish --no-git-checks --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
12 changes: 5 additions & 7 deletions .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ on:
paths:
- "**/*.ts"
- "**/*.spec.ts"
- "package.json"
- "pnpm-lock.yaml"

pull_request:
branches: [main]
paths:
- "**/*.ts"
- "**/*.spec.ts"
- "package.json"
- "pnpm-lock.yaml"

jobs:
Expand Down Expand Up @@ -75,17 +73,17 @@ jobs:
const baseCoverage = parseFloat('${{ steps.base_coverage.outputs.coverage }}');
const delta = (prCoverage - baseCoverage).toFixed(2);

let comment = '';
let comment = '## Coverage Change\n\n This Comment is auto generated by GitHub Actions.\n\n';

if (prCoverage === baseCoverage && baseCoverage === 100) {
comment = `🟢 **Test coverage unchanged**: ${prCoverage}%`;
comment += `🟢 **Test coverage unchanged**: ${prCoverage}%`;
} else {
if (delta > 0) {
comment = `🟢 **Test coverage increased**: ${prCoverage}% (+${delta}%)`;
comment += `🟢 **Test coverage increased**: ${prCoverage}% (+${delta}%)`;
} else if (delta < 0) {
comment = `🔴 **Test coverage decreased**: ${prCoverage}% (${delta}%)`;
comment += `🔴 **Test coverage decreased**: ${prCoverage}% (${delta}%)`;
} else {
comment = `🟡 **Test coverage unchanged**: ${prCoverage}%`;
comment += `🟡 **Test coverage unchanged**: ${prCoverage}%`;
}
}

Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [1.0.4](https://github.com/99mini/fx/compare/v1.0.3...v1.0.4) (2025-06-03)


### Chores

* change pr comment ([510de5e](https://github.com/99mini/fx/commit/510de5eee66c8716ebe0ae3ddcb5af0f9b12f4e4))
* fix packages ([bb66a50](https://github.com/99mini/fx/commit/bb66a50d856a70b6110806b97c1eb53a0bbfc5ac))
* publish local test ([6877a87](https://github.com/99mini/fx/commit/6877a8735cc76960292c97b5bc92b5d045c16827))
* update packages ([1ff209c](https://github.com/99mini/fx/commit/1ff209c36374656a63ef9abadf60ce9e7c04c848))

### 1.0.3 (2025-06-03)


Expand Down
25 changes: 22 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@99mini/fx",
"version": "1.0.3",
"version": "1.0.4",
"description": "javascript/typescript functional programming examples",
"keywords": [
"javascript",
Expand All @@ -9,12 +9,32 @@
"lazy evaluation"
],
"type": "module",
"author": "99mini",
"author": {
"name": "99mini",
"email": "0mini9939@gmail.com",
"url": "https://github.com/99mini"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/99mini/fx.git"
},
"homepage": "https://github.com/99mini/fx#readme",
"bugs": {
"email": "0mini9939@gmail.com",
"url": "https://github.com/99mini/fx/issues"
},
"packageManager": "pnpm@10.8.0",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"types": "./dist/types/index.d.ts",
"files": [
"dist",
"package.json",
"README.MD",
"CHANGELOG.md",
"badges"
],
"exports": {
".": {
"import": "./dist/index.esm.js",
Expand All @@ -33,7 +53,6 @@
"build": "pnpm clean && pnpm build:types && pnpm build:rollup",
"ci": "pnpm run test:coverage && pnpm run badge",
"prepublish": "pnpm run build",
"publish": "npm publish --access public",
"release": "standard-version",
"release:minor": "standard-version --release-as minor",
"release:patch": "standard-version --release-as patch",
Expand Down