Skip to content

Feat/#92. Github Actions μžλ™ν™” μ½”λ“œ μΆ”κ°€ #1

Feat/#92. Github Actions μžλ™ν™” μ½”λ“œ μΆ”κ°€

Feat/#92. Github Actions μžλ™ν™” μ½”λ“œ μΆ”κ°€ #1

# Tag 생성 및 Release 생성
name: Versioning - Tagging and Release
on:
pull_request:
branches:
- develop
types:
- closed
jobs:
check-branch:
runs-on: ubuntu-latest
outputs:
current_branch: ${{ steps.branch-name.outputs.current_branch }}
steps:
- name: Get branch names
id: branch-name
uses: tj-actions/branch-names@v8
# Release λ˜λŠ” Hotfix λΈŒλžœμΉ˜κ°€ merge λ λ•Œ μ‹€ν–‰
tagging-and-release:
needs: check-branch
runs-on: 'ubuntu-latest'
if: github.event.pull_request.merged == true && (startsWith(${{ needs.check-branch.outputs.current_branch }}, 'release/') || startsWith(${{ needs.check-branch.outputs.current_branch }}, 'hotfix/'))
steps:
- name: Get tag
id: get-tag
run: |
branch=${{ needs.check-branch.outputs.current_branch }}
new_tag="${branch#release/}"
new_tag="${new_tag#hotfix/}"
echo "NEW_TAG=$new_tag" >> $GITHUB_OUTPUT
- name: Check tag
run: |
echo ${{ steps.get-tag.outputs.NEW_TAG }}
- name: Create Release & Tag
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.MY_TOKEN }}
with:
tag_name: ${{ steps.get-tag.outputs.NEW_TAG }}
release_name: ${{ steps.get-tag.outputs.NEW_TAG }}
body: |
${{ github.event.pull_request.body }}