Skip to content

Commit 9c8a7f4

Browse files
feat: refactor pipeline
1 parent eba4628 commit 9c8a7f4

1 file changed

Lines changed: 1 addition & 64 deletions

File tree

.github/workflows/bump-and-release.yml

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -154,39 +154,6 @@ jobs:
154154
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
155155
echo "New version: $NEW_VERSION"
156156
157-
- name: Create Changelog Entry
158-
id: changelog
159-
run: |
160-
VERSION=${{ steps.new_version.outputs.version }}
161-
TARGET_BRANCH=${{ github.event.pull_request.base.ref }}
162-
TIMESTAMP=$(date -u +'%Y-%m-%d')
163-
PR_NUMBER=${{ github.event.pull_request.number }}
164-
PR_TITLE="${{ github.event.pull_request.title }}"
165-
166-
CHANGELOG="## [$VERSION] - $TIMESTAMP
167-
168-
### Release Information
169-
- **Branch**: $TARGET_BRANCH
170-
- **PR**: #$PR_NUMBER
171-
- **Title**: $PR_TITLE
172-
- **Merged by**: @${{ github.event.pull_request.merged_by.login }}
173-
174-
### Changes
175-
- Bump version to $VERSION
176-
177-
"
178-
179-
if [ -f CHANGELOG.md ]; then
180-
echo "$CHANGELOG" | cat - CHANGELOG.md > CHANGELOG.md.tmp
181-
mv CHANGELOG.md.tmp CHANGELOG.md
182-
else
183-
echo "$CHANGELOG" > CHANGELOG.md
184-
fi
185-
186-
echo "changelog<<EOF" >> $GITHUB_OUTPUT
187-
echo "$CHANGELOG" >> $GITHUB_OUTPUT
188-
echo "EOF" >> $GITHUB_OUTPUT
189-
190157
- name: Commit Changes
191158
run: |
192159
git add CHANGELOG.md
@@ -235,34 +202,4 @@ jobs:
235202
236203
## Changelog
237204
${{ steps.changelog.outputs.changelog }}
238-
239-
## Release Notes
240-
- กฎหลัก:
241-
- Merge -> `main`: ถ้า branch ต้นทางเป็น `fix/*` หรือ `hotfix/*` จะ bump patch, มิฉะนั้น bump minor.
242-
- Merge -> `development`: สร้างหรือเพิ่ม pre-release บนฐานเวอร์ชันปัจจุบัน เป็น `vMAJOR.MINOR.PATCH-dev.N`.
243-
- หาก branch ต้นทางเป็น `fix/*` และ merge เข้า `development` จะได้รูป `vMAJOR.MINOR.PATCH-dev.N-patch.M`.
244-
- การตรวจหาเวอร์ชันปัจจุบัน: workflow จะเลือกจาก `git tags` (รวม pre-release) เป็นหลัก ถ้าไม่มีจึงใช้ Releases API.
245-
- ระบบจะตรวจและเพิ่ม counter จนกว่าจะได้ tag ที่ไม่ซ้ำกับที่มีอยู่แล้ว.
246-
draft: false
247-
prerelease: ${{ contains(github.event.pull_request.base.ref, 'development') }}
248-
249-
- name: Comment on PR
250-
uses: actions/github-script@v7
251-
with:
252-
github-token: ${{ secrets.GITHUB_TOKEN }}
253-
script: |
254-
github.rest.issues.createComment({
255-
issue_number: context.issue.number,
256-
owner: context.repo.owner,
257-
repo: context.repo.repo,
258-
body: `✅ **Release Created**\n\n- **Version**: v${{ steps.new_version.outputs.version }}\n- **Previous**: ${{ steps.current_version.outputs.version }}\n- **Branch**: ${{ github.event.pull_request.base.ref }}\n- **Tag**: [v${{ steps.new_version.outputs.version }}](${{ github.server_url }}/${{ github.repository }}/releases/tag/v${{ steps.new_version.outputs.version }})`
259-
})
260-
261-
- name: Notify Success
262-
run: |
263-
echo "✅ Version bumped successfully!"
264-
echo "- Old version: ${{ steps.current_version.outputs.version }}"
265-
echo "- New version: ${{ steps.new_version.outputs.version }}"
266-
echo "- Tag: v${{ steps.new_version.outputs.version }}"
267-
echo "- Target branch: ${{ github.event.pull_request.base.ref }}"
268-
205+
draft: false

0 commit comments

Comments
 (0)