From 22d0fb7e76d3babc54458d8b94cf0db56a81d8ea Mon Sep 17 00:00:00 2001 From: Tobias Lekman Date: Sat, 30 Nov 2024 09:48:52 +0000 Subject: [PATCH] feat: enhance release workflow to support version bumps and new releases --- .github/workflows/cd_release_please.yml | 27 ++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd_release_please.yml b/.github/workflows/cd_release_please.yml index 82c56df..b8026b6 100644 --- a/.github/workflows/cd_release_please.yml +++ b/.github/workflows/cd_release_please.yml @@ -3,6 +3,8 @@ name: "Release Please" on: workflow_dispatch: push: + # Run on main branch changes and let release-please create + # PRs for version bumps and new releases branches: - main paths: @@ -10,10 +12,18 @@ on: - "**/*.cs*" - ".release-please-manifest.json" - "release-please-config.json" + pull_request: + # Only run during a PR if the release-please manifest has changed, + # meaning that versions are attempting to be updated. + types: [opened, synchronize, reopened] + paths: + - ".release-please-manifest.json" jobs: - release: + release-please: name: Release Please + # Only run on main, after merge is completed + if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: - name: Checkout repository @@ -30,6 +40,21 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} + bump-versions: + name: Bump Versions + # Only run on pull requests or on feature branches + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Bumpy bump + uses: lekman/release-please-dotnet@feature/prereq + with: + manifest: ".release-please-manifest.json" + # - name: Setup .NET # uses: actions/setup-dotnet@v4 # with: