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 Sep 8, 2024
1 parent b7b054d commit 513de9c
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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: lukka/get-cmake@latest

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

- name: Generate plasmoid package
if: ${{ steps.release.outputs.release_created }}
run: |
sudo apt-get install -y extra-cmake-modules
./package-plasmoid.sh
- 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: Upload plasmoid 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}}.plasmoid
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.2.2"
}
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://github.com/googleapis/release-please/main/schemas/config.json"
}

0 comments on commit 513de9c

Please sign in to comment.