Skip to content

Commit

Permalink
ci: add release-please workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Mogyuchi <[email protected]>
  • Loading branch information
Mogyuchi committed Jan 17, 2024
1 parent 744bb3b commit 50899d0
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/files/release-please/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{

Check warning on line 1 in .github/files/release-please/.release-please-manifest.json

View workflow job for this annotation

GitHub Actions / Lint Codebase

File ignored by default.
".": "0.1.0"
}
77 changes: 77 additions & 0 deletions .github/files/release-please/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{

Check warning on line 1 in .github/files/release-please/release-please-config.json

View workflow job for this annotation

GitHub Actions / Lint Codebase

File ignored by default.
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"changelog-sections": [
{
"type": "feat",
"section": "Features",
"hidden": false
},
{
"type": "fix",
"section": "Bug Fixes",
"hidden": false
},
{
"type": "perf",
"section": "Performance Improvements",
"hidden": false
},
{
"type": "deps",
"section": "Dependencies",
"hidden": false
},
{
"type": "revert",
"section": "Reverts",
"hidden": false
},
{
"type": "docs",
"section": "Documentation",
"hidden": true
},
{
"type": "style",
"section": "Styles",
"hidden": true
},
{
"type": "chore",
"section": "Miscellaneous Chores",
"hidden": true
},
{
"type": "refactor",
"section": "Code Refactoring",
"hidden": true
},
{
"type": "test",
"section": "Tests",
"hidden": true
},
{
"type": "build",
"section": "Build System",
"hidden": true
},
{
"type": "ci",
"section": "Continuous Integration",
"hidden": true
}
],
"packages": {
".": {
"changelog-path": "CHANGELOG.md",
"release-type": "node",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": false,
"draft": false,
"prerelease": false,
"include-component-in-tag": false,
"pull-request-title-pattern": "release: v${version}"
}
}
}
45 changes: 45 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
on:
push:
branches: main

name: release-please

jobs:
release-please:
if: github.repository_owner == '4m-mazi'
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release-please.outputs.release_created }}
steps:
- uses: google-github-actions/release-please-action@cc61a07e2da466bebbc19b3a7dd01d6aecb20d1e # v4.0.2
id: release-please
with:
config-file: .github/files/release-please/release-please-config.json
manifest-file: .github/files/release-please/.release-please-manifest.json
skip-github-pull-request: ${{ startsWith(github.event.head_commit.message, 'release:') && github.event.head_commit.author.name == 'github-actions[bot]' }}

label-published:
needs: [release-please]
if: ${{ needs.release-please.outputs.release_created }}
permissions:
pull-requests: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
runs-on: ubuntu-latest
steps:
- name: Create published label
run: |
gh label create 'autorelease: published' --color=EDEDED || true
- name: Get PR number
id: pr-number
run: |
echo "pr_number=$(printf '${{ github.event.head_commit.message }}' | head -n1 | sed -nE 's/.+\(#([0-9]+)\)$/\1/p')" >> "$GITHUB_OUTPUT"
- name: Change labels on PR
run: |
gh pr edit ${{ steps.pr-number.outputs.pr_number }} \
--remove-label='autorelease: tagged' \
--add-label='autorelease: published'

0 comments on commit 50899d0

Please sign in to comment.