Skip to content

Commit

Permalink
implement last CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
salvatoreolivieri committed Nov 13, 2024
1 parent 8e02b8b commit 045de4f
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
with:
# this assumes that you have created a personal access token
# (PAT) and configured it as a GitHub action secret named
# `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
# this is a built-in strategy in release-please, see "Action Inputs"
# for more options
release-type: simple
32 changes: 32 additions & 0 deletions .github/workflows/update-api-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Update Version and Release
on:
push:
branches:
- main

permissions:
contents: write

jobs:
update-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Extract latest version from CHANGELOG.md
id: get_version
run: |
VERSION=$(grep -oP '\[\K[0-9]+\.[0-9]+\.[0-9]+' CHANGELOG.md | head -1)
echo "::set-output name=VERSION::$VERSION"
- name: Update version in cmd/api/main.go
run: |
sed -i "s/var version = \".*\"/var version = \"${{ steps.get_version.outputs.VERSION }}\"/" cmd/api/main.go
- name: Commit and push if changed
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
git add cmd/api/main.go
git commit -m "Update version to ${{ steps.get_version.outputs.VERSION }}" || echo "No changes to commit"
git push

0 comments on commit 045de4f

Please sign in to comment.