diff --git a/.github/workflows/auto-changelog.yml b/.github/workflows/auto-changelog.yml index 6e86daa..d679913 100644 --- a/.github/workflows/auto-changelog.yml +++ b/.github/workflows/auto-changelog.yml @@ -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')}}" @@ -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 @@ -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 diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index d608cb2..6e0afe9 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -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')}}" @@ -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<> $GITHUB_OUTPUT echo "$CHANGELOG_CONTENT" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT @@ -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 }} diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml index 56bd7aa..bbe5c67 100644 --- a/.github/workflows/test-coverage.yml +++ b/.github/workflows/test-coverage.yml @@ -10,7 +10,6 @@ on: paths: - "**/*.ts" - "**/*.spec.ts" - - "package.json" - "pnpm-lock.yaml" pull_request: @@ -18,7 +17,6 @@ on: paths: - "**/*.ts" - "**/*.spec.ts" - - "package.json" - "pnpm-lock.yaml" jobs: @@ -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}%`; } } diff --git a/CHANGELOG.md b/CHANGELOG.md index 27cc4fa..2082db9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/package.json b/package.json index 94bc75d..073bced 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@99mini/fx", - "version": "1.0.3", + "version": "1.0.4", "description": "javascript/typescript functional programming examples", "keywords": [ "javascript", @@ -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", @@ -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",