Skip to content

Commit

Permalink
ci: automate releases and changelog with googleapis/release-please-ac…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
luisbocanegra committed Dec 9, 2024
1 parent 774f9b5 commit 4535202
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}

- name: Extract project name
if: ${{ steps.release.outputs.release_created }}
run: |
PROJECT_NAME=$(grep -Po '(?<=project\().*(?=\))' CMakeLists.txt)
echo "PROJECT_NAME=$PROJECT_NAME" >> $GITHUB_ENV
- name: Generate wallpaper package
if: ${{ steps.release.outputs.release_created }}
run: |
cd ./package
zip -r ../${{ env.PROJECT_NAME }}-${{steps.release.outputs.tag_name}}.zip .
- name: Upload wallpaper package to release
if: ${{ steps.release.outputs.release_created }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ steps.release.outputs.tag_name }} ./${{ env.PROJECT_NAME }}-${{steps.release.outputs.tag_name}}.zip
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.4.1"
}
16 changes: 16 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"packages": {
".": {
"changelog-path": "CHANGELOG.md",
"release-type": "simple",
"extra-files": [
{
"type": "json",
"path": "package/metadata.json",
"jsonpath": "$.KPlugin.Version"
}
]
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}

0 comments on commit 4535202

Please sign in to comment.