Release Please / Semantic Release μλ λ²μ κ΄λ¦¬ YAML μμ
Conventional Commits(feat, fix, BREAKING CHANGE) κΈ°λ°μΌλ‘ SemVer λ²μ μλ κ³μ°, CHANGELOG.md κ°±μ , Release PR λ° GitHub Release νκ·Έ μμ±μ μλννλ Release Please μν¬νλ‘μ° YAML μμμ λλ€.
π μμ κ°μ
μλμΌλ‘ λ²μ λ²νΈλ₯Ό μ¬λ¦¬κ³ CHANGELOG.mdλ₯Ό νΈμ§νλ λ°λ³΅ μμ
μ μ κ±°νκΈ° μν΄ Google release-please-action μ λμ
νλ νμ€ GitHub Actions YAML λ° μ€μ νμΌ μμμ
λλ€.main λΈλμΉμ feat:, fix: 컀λ°μ΄ μμ΄λ©΄ μλμΌλ‘ Release PRμ μ μ§νκ³ , ν΄λΉ PRμ λ¨Έμ§νλ μκ° Git νκ·Έ + GitHub Release + npm/Docker λ°°ν¬κ° μλμΌλ‘ μ€νλ©λλ€.
# .github/workflows/release-please.yml
name: Release Please Automation
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- name: Run Release Please
id: release
uses: googleapis/release-please-action@v4
with:
# μ μ₯μ 루νΈμ release-please-config.json λ° .release-please-manifest.json μ°Έμ‘°
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
# Release PRμ΄ λ¨Έμ§λμ΄ μ€μ νκ·Έκ° μμ±λ κ²½μ°μλ§ λ°°ν¬ μ‘ μ€ν
publish-artifact:
needs: release-please
if: ${{ needs.release-please.outputs.release_created == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build & Publish Release
run: |
echo "Deploying version ${{ needs.release-please.outputs.tag_name }}"
# npm publish --access public λλ docker buildx push μ€ν
βοΈ λλ° μ€μ νμΌ (release-please-config.json & .release-please-manifest.json)
μ μ₯μ 루νΈμ μλ λ νμΌμ ν¨κ» λ°°μΉνλ©΄ λ¨μΌ/λͺ¨λ Έλ ν¬ ν¨ν€μ§ λ²μ κ³Ό CHANGELOG μΉμ μ μ λ°νκ² μ μ΄ν μ μμ΅λλ€.
// release-please-config.json
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"packages": {
".": {
"release-type": "node",
"changelog-sections": [
{ "type": "feat", "section": "β¨ Features" },
{ "type": "fix", "section": "π Bug Fixes" },
{ "type": "perf", "section": "β‘ Performance Improvements" },
{ "type": "refactor", "section": "β»οΈ Code Refactoring", "hidden": false },
{ "type": "chore", "section": "π§ Miscellaneous", "hidden": true }
]
}
}
}
// .release-please-manifest.json (μ΅μ΄ μμ λ²μ μ§μ )
{
".": "1.0.0"
}
π Conventional Commits λ²μ μ¦κ° κ·μΉ μμ½
| μ»€λ° λ©μμ§ μ λμ¬ | SemVer μ¦κ° | μμ |
|---|---|---|
fix: ... |
Patch (1.0.0 β 1.0.1) |
fix(auth): λ§λ£λ 리νλ μ ν ν° 500 μλ¬ μμ |
feat: ... |
Minor (1.0.1 β 1.1.0) |
feat(billing): ν μ€νμ΄λ¨ΌμΈ μ κΈ°κ²°μ μΉν
μΆκ° |
feat!: ... λλ BREAKING CHANGE: |
Major (1.1.0 β 2.0.0) |
feat(api)!: v1 μ£Όλ¬Έ μλ΅ νλ camelCase ν΅μΌ |
μ견 λ° μ§λ¬Έ
0μμ§ λ±λ‘λ μκ²¬μ΄ μμ΅λλ€. 첫 λ²μ§Έ λκΈμ λ¨κ²¨λ³΄μΈμ!
λκΈ μμ
λκΈ μμ