Skip to content

Commit

Permalink
ci: enable release-please
Browse files Browse the repository at this point in the history
Signed-off-by: You-Sheng Yang <[email protected]>
  • Loading branch information
vicamo committed Apr 9, 2024
1 parent f5c93e9 commit 4139d18
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/release-please/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.0.0"
}
49 changes: 49 additions & 0 deletions .github/release-please/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"changelog-sections": [
{
"section": "🚀 Features",
"type": "feat"
},
{
"section": "🐛 Bugfixes",
"type": "fix"
},
{
"section": "⬆️ Dependency updates",
"type": "deps"
},
{
"section": "🧰 Maintenance",
"type": "build"
},
{
"section": "🧰 Maintenance",
"type": "chore"
},
{
"section": "🧰 Testing",
"type": "ci"
},
{
"section": "🧰 Testing",
"type": "tests"
},
{
"section": "🧰 Maintenance",
"type": "packaging"
},
{
"section": "🧰 Documentation",
"type": "docs"
}
],
"packages": {
".": {
"changelog-path": "CHANGELOG.md",
"include-component-in-tag": false,
"release-type": "simple",
"extra-files": ["README.md"]
}
}
}
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
id: rp
with:
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
config-file: .github/release-please/release-please-config.json
manifest-file: .github/release-please/.release-please-manifest.json

- uses: actions/checkout@v4
if: ${{ steps.rp.outputs.release_created }}

- name: Update major/minor tags
if: ${{ steps.rp.outputs.release_created }}
run: |
git config user.name "github-actions[bot]"
git config user.email "[email protected]"
full_tag="${{ steps.rp.outputs.tag_name }}"
major_minor_tag="${full_tag%.*}"
major_tag="${major_minor_tag%.*}"
git tag -d "${major_tag}" "${major_minor_tag}" || true
git tag -a "${major_tag}" -m "Release ${major_tag}"
git tag -a "${major_minor_tag}" -m "Release ${major_minor_tag}"
git push -f origin "${major_tag}" "${major_minor_tag}"

0 comments on commit 4139d18

Please sign in to comment.