Skip to content

Commit

Permalink
[feat] Release Label 자동 생성 (#140)
Browse files Browse the repository at this point in the history
* [feat] #136 integrate CI workflow

* [feat] #136 add 'create-release' steps in prod-cd
  • Loading branch information
tkdwns414 authored Sep 7, 2024
1 parent db066d3 commit 85ffb63
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 33 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/prod-ci.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
name: prod-CI
name: CI

on:
pull_request:
branches: [ "main" ]
branches:
- '*'

jobs:
build:
runs-on: ubuntu-22.04

steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.SUBMODULE_TOKEN }}
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/dev-ci.yml

This file was deleted.

33 changes: 31 additions & 2 deletions .github/workflows/prod-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ jobs:
env:
working-directory: .


steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.SUBMODULE_TOKEN }}
Expand Down Expand Up @@ -60,3 +59,33 @@ jobs:
script: |
cd ~
./deploy.sh
create-release:
needs: cd
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: 버전 정보 추출
id: extract_version_name
run: |
VERSION=$(echo "${{ github.event.head_commit.message }}" | egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -n1 | tr -d '[:space:]')
if [ -z "$VERSION" ]; then
echo "No version found in the commit message."
exit 1
fi
- name: Create GitHub Release
run: |
response=$(curl -s -o /dev/null -w "%{http_code}" -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.SUBMODULE_TOKEN }}" \
https://api.github.com/repos/OMZigak/KKUMER/releases \
-d '{"tag_name":"${{ steps.extract_version_name.outputs.version }}","target_commitish":"main","name":"${{ steps.extract_version_name.outputs.version }}","generate_release_notes":true}')
if [ "$response" -ne 201 ]; then
echo "GitHub Release failed with status code $response"
exit 1
fi

0 comments on commit 85ffb63

Please sign in to comment.