From a914997ec4b1994cbd18e55ae95cc37c8abf1b34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Irzyk?= <108666440+pawelirh@users.noreply.github.com> Date: Wed, 1 May 2024 17:22:18 +0200 Subject: [PATCH] Ros2 workflow missing arguments (#49) * Add missing merge arg * Fix release workflow * Rename steps * Fix prerelease step --- .github/workflows/release-repository.yaml | 53 ++++++++++------------- 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/.github/workflows/release-repository.yaml b/.github/workflows/release-repository.yaml index bef5bdf..a89f9f2 100644 --- a/.github/workflows/release-repository.yaml +++ b/.github/workflows/release-repository.yaml @@ -56,47 +56,42 @@ jobs: if: ${{ fromJSON(github.event.inputs.automatic_mode) == true }} run: | gh pr merge ${{ steps.create_release_candidate.outputs.created_branch }} \ - --delete-branch + --merge --delete-branch - - name: Create tag - if: ${{ fromJSON(github.event.inputs.automatic_mode) == true }} + - name: Checkout to main + if: ${{ github.event.inputs.target_branch != env.MAIN_BRANCH && fromJSON(github.event.inputs.automatic_mode) == true }} + uses: actions/checkout@v4 + with: + ref: ${{ env.MAIN_BRANCH }} + + - name: Create pull request to main + if: ${{ github.event.inputs.target_branch != env.MAIN_BRANCH && fromJSON(github.event.inputs.automatic_mode) == true }} run: | - git checkout ${{ github.event.inputs.target_branch }} - git tag ${{ steps.create_release_candidate.outputs.version }} - git push origin ${{ steps.create_release_candidate.outputs.version }} + gh pr create \ + --base ${{ env.MAIN_BRANCH }} \ + --head ${{ github.event.inputs.target_branch }} \ + --title "Release ${{ steps.create_release_candidate.outputs.version}} to ${{ env.MAIN_BRANCH }}" \ + --body "This PR incorporates package(s) version and changelog update." + + - name: Merge pull request to main + if: ${{ github.event.inputs.target_branch != env.MAIN_BRANCH && fromJSON(github.event.inputs.automatic_mode) == true }} + run: | + gh pr merge ${{ github.event.inputs.target_branch }} \ + --merge --delete-branch - name: Create prerelease if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && fromJSON(github.event.inputs.prerelease) == true}} run: | gh release create ${{ steps.create_release_candidate.outputs.version }} \ + --target ${{ env.MAIN_BRANCH }} \ --title ${{ github.event.inputs.release_name }} \ - --notes-from-tag \ + --generate-notes \ --prerelease - name: Create release if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && fromJSON(github.event.inputs.prerelease) == false}} run: | gh release create ${{ steps.create_release_candidate.outputs.version }} \ + --target ${{ env.MAIN_BRANCH }} \ --title ${{ github.event.inputs.release_name }} \ - --notes-from-tag - - - name: Create pull request to main branch - if: ${{ github.event.inputs.target_branch != env.MAIN_BRANCH && fromJSON(github.event.inputs.automatic_mode) == true }} - run: | - gh pr create \ - --base ${{ env.MAIN_BRANCH }} \ - --head ${{ github.event.inputs.target_branch }} \ - --title "Release ${{ steps.create_release_candidate.outputs.version}} to main" \ - --body "This PR incorporates package(s) version and changelog update." - - - name: Checkout to main - if: ${{ github.event.inputs.target_branch != env.MAIN_BRANCH && fromJSON(github.event.inputs.automatic_mode) == true }} - uses: actions/checkout@v4 - with: - ref: ${{ env.MAIN_BRANCH }} - - - name: Merge pull request - if: ${{ github.event.inputs.target_branch != env.MAIN_BRANCH && fromJSON(github.event.inputs.automatic_mode) == true }} - run: | - gh pr merge ${{ github.event.inputs.target_branch }} \ - --delete-branch + --generate-notes