학습을 진행하면서 작성했습니다..! 잘못된 정보가 있다면 말씀 부탁드립니다!!
버전 upgrade 시 latest release를 기준으로 version update를 해주는데, 이 기능이 너무 좋아보였다..!!
추후에 minor update를 할 때 스크립트를 가다듬으면 버전 관리를 더 잘 할 수 있을 것 같다.
release 이후 hotfix를 한다면 버전 관리를 어떻게 하면 좋을지 고민이다.
일반적으로는 commit message, github PR 만들때 PR tag 등으로 어떤 종류의 version update인지 명시하는 방식이 있다고 한다. (추후에 업데이트 해보겠습니다..!)
적용을 하기 위해서는 .github/workflows/
하위에 yml 파일을 하나 만든다.
name: Release Github Application Version
on:
pull_request:
branches:
- release
jobs:
release-application:
runs-on: ubuntu-latest
steps:
- name: Github Release 최신 tag 받아오기
id: tag_version
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: GitHub project release 업데이트
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
현재까지 github에 등록되어 있는 latest release의 버전 정보를 가져온다.
결과값으로 가져온 outputs의 new_tag
는 설정에 맞게 다음 버전을 가져온다. (previous_tag
는 현재 lastest version을 가져온다!)
changelog
는 직전 버전과 비교하여 어떤 변화가 생겼는지 알려준다.
changelog
를 body에 넣어주면 commit header나 label을 바탕으로 구분해서 해당 release에 어떤 변화가 있었는지 알려준다!! (개꿀)원래는 github release를 하나 하나 수작업으로 해야 했었는데, github actions를 통해서 귀찮은 작업을 줄일 수 있었다!