Skip to content

Commit 3cf86aa

Browse files
authored
Merge pull request #31 from YAPP-Github/chore/PRODUCT-63
[Chore] Flyway 도입 및 CI/CD 파이프라인 개선
2 parents 51c541e + fca7d4d commit 3cf86aa

File tree

5 files changed

+64
-8
lines changed

5 files changed

+64
-8
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Close Jira issue
2+
on:
3+
issues:
4+
types:
5+
- closed
6+
7+
jobs:
8+
close-issue:
9+
name: Close Jira issue
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Login to Jira
14+
uses: atlassian/gajira-login@v3
15+
env:
16+
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
17+
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
18+
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
19+
20+
- name: Extract Jira issue key from GitHub issue title
21+
id: extract-key
22+
run: |
23+
ISSUE_TITLE="${{ github.event.issue.title }}"
24+
JIRA_KEY=$(echo "$ISSUE_TITLE" | grep -oE '[A-Z]+-[0-9]+')
25+
echo "JIRA_KEY=$JIRA_KEY" >> $GITHUB_ENV
26+
27+
- name: Close Jira issue
28+
if: env.JIRA_KEY != ''
29+
uses: atlassian/gajira-transition@v3
30+
with:
31+
issue: ${{ env.JIRA_KEY }}

.github/workflows/create-jira-issue.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
1616
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
1717

18-
- name: Checkout main code
18+
- name: Checkout develop code
1919
uses: actions/checkout@v4
2020
with:
21-
ref: main
21+
ref: develop
2222

2323
- name: Issue Parser
2424
uses: stefanbuck/github-issue-parser@v3

.github/workflows/deploy-prod.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ jobs:
9292
needs: terraform-apply-prod
9393
steps:
9494
- uses: actions/checkout@v4
95+
with:
96+
fetch-depth: 0
97+
fetch-tags: true
9598

9699
- name: Parse Terraform Outputs and Set Environment Variables
97100
run: |
@@ -114,7 +117,7 @@ jobs:
114117
node-version: '22'
115118

116119
- name: Install Semantic Release dependencies
117-
run: npm install semantic-release @semantic-release/commit-analyzer @semantic-release/release-notes-generator conventional-changelog-conventionalcommits
120+
run: npm install semantic-release @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/github @semantic-release/changelog @semantic-release/git conventional-changelog-conventionalcommits
118121

119122
- name: Semantic Release (Dry Run)
120123
id: get_version
@@ -124,18 +127,23 @@ jobs:
124127
echo "SEMANTIC_VERSION=${{ github.event.inputs.rollback_version }}" >> $GITHUB_ENV
125128
else
126129
echo "Running semantic-release to determine next version..."
127-
OUTPUT=$(./node_modules/.bin/semantic-release --dry-run --no-ci)
130+
OUTPUT=$(./node_modules/.bin/semantic-release --dry-run --no-ci || true)
128131
echo "$OUTPUT"
129-
VERSION=$(echo "$OUTPUT" | grep -oP 'The next release version is \K[0-9.a-z-]+')
132+
133+
VERSION=$(echo "$OUTPUT" | grep -oP 'Published release \K[0-9.a-z-]+|The next release version is \K[0-9.a-z-]+' | head -n 1)
134+
130135
if [ -z "$VERSION" ]; then
131136
echo "릴리즈할 새로운 버전이 없습니다. 배포를 건너뜁니다."
132-
exit 0
137+
echo "SEMANTIC_VERSION=" >> $GITHUB_ENV
138+
else
139+
echo "Determined version: $VERSION"
140+
echo "SEMANTIC_VERSION=$VERSION" >> $GITHUB_ENV
133141
fi
134-
echo "SEMANTIC_VERSION=$VERSION" >> $GITHUB_ENV
135142
fi
136143
env:
137144
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
138145

146+
139147
- name: Set up JDK 21
140148
uses: actions/setup-java@v4
141149
with:
@@ -188,7 +196,7 @@ jobs:
188196
wait-for-service-stability: true
189197

190198
- name: Semantic Release (Final)
191-
if: success() && env.SEMANTIC_VERSION != '' && github.event.inputs.rollback_version == ''
199+
if: success() && env.SEMANTIC_VERSION != '' && (github.event.inputs.rollback_version == null || github.event.inputs.rollback_version == '')
192200
run: |
193201
./node_modules/.bin/semantic-release --no-ci
194202
env:

.releaserc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@
2929
{
3030
"preset": "conventionalcommits"
3131
}
32+
],
33+
"@semantic-release/changelog",
34+
"@semantic-release/github",
35+
[
36+
"@semantic-release/git", {
37+
"assets": ["CHANGELOG.md"],
38+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
39+
}
3240
]
3341
]
3442
}

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## [1.1.0](https://github.com/YAPP-Github/26th-Web-Team-1-BE/compare/v1.0.1...v1.1.0) (2025-06-20)
2+
3+
### Features
4+
5+
* 시맨틱 릴리즈 플러그인 추가 ([8a9a53a](https://github.com/YAPP-Github/26th-Web-Team-1-BE/commit/8a9a53a52eb063830980c5a9f520d216451489b7))
6+
7+
### Bug Fixes
8+
9+
* 시맨틱 릴리즈 플러그인 수정 ([95bb65c](https://github.com/YAPP-Github/26th-Web-Team-1-BE/commit/95bb65c7815234e2f76b0ac3b0b7ec787215cec9))

0 commit comments

Comments
 (0)