Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelirh committed May 1, 2024
1 parent 7e1b04f commit d7cb10b
Showing 1 changed file with 78 additions and 70 deletions.
148 changes: 78 additions & 70 deletions .github/workflows/release-repository.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,73 +30,81 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAIN_BRANCH: ros2
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.target_branch }}

- name: Create release candidate
id: create_release_candidate
uses: at-wat/catkin-release-action@v1
with:
version: ${{ github.event.inputs.version }}
git_user: action-bot
git_email: [email protected]
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Create pull request
run: |
gh pr create \
--base ${{ github.event.inputs.target_branch }} \
--head ${{ steps.create_release_candidate.outputs.created_branch }} \
--title "Release ${{ steps.create_release_candidate.outputs.version}}" \
--body "This PR incorporates package(s) version and changelog update."
- name: Merge pull request
if: ${{ github.event.inputs.automatic_mode == true }}
run: |
gh pr merge ${{ steps.create_release_candidate.outputs.created_branch }} \
--delete-branch
- name: Create tag
if: ${{ 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 }}
- name: Create prerelease
if: ${{ github.event.inputs.automatic_mode == true && github.event.inputs.prerelease == true}}
run: |
gh release create ${{ steps.create_release_candidate.outputs.version }} \
--title ${{ github.event.inputs.release_name }} \
--notes-from-tag \
--prerelease
- name: Create release
if: ${{ github.event.inputs.automatic_mode == true && github.event.inputs.prerelease == false}}
run: |
gh release create ${{ steps.create_release_candidate.outputs.version }} \
--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 && 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 && 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 && github.event.inputs.automatic_mode == true }}
run: |
gh pr merge ${{ github.event.inputs.target_branch }} \
--delete-branch
- name: Test if automatic_mode is true
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true }}
run: echo "Automatic mode is true"
- name: Test if automatic_mode is false
if: ${{ fromJSON(github.event.inputs.automatic_mode) == false }}
run: echo "Automatic mode is false"
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# ref: ${{ github.event.inputs.target_branch }}
#
# - name: Create release candidate
# id: create_release_candidate
# uses: at-wat/catkin-release-action@v1
# with:
# version: ${{ github.event.inputs.version }}
# git_user: action-bot
# git_email: [email protected]
# github_token: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Create pull request
# run: |
# gh pr create \
# --base ${{ github.event.inputs.target_branch }} \
# --head ${{ steps.create_release_candidate.outputs.created_branch }} \
# --title "Release ${{ steps.create_release_candidate.outputs.version}}" \
# --body "This PR incorporates package(s) version and changelog update."
#
# - name: Merge pull request
# if: ${{ github.event.inputs.automatic_mode == true }}
# run: |
# gh pr merge ${{ steps.create_release_candidate.outputs.created_branch }} \
# --delete-branch
#
# - name: Create tag
# if: ${{ 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 }}
#
# - name: Create prerelease
# if: ${{ github.event.inputs.automatic_mode == true && github.event.inputs.prerelease == true}}
# run: |
# gh release create ${{ steps.create_release_candidate.outputs.version }} \
# --title ${{ github.event.inputs.release_name }} \
# --notes-from-tag \
# --prerelease
#
# - name: Create release
# if: ${{ github.event.inputs.automatic_mode == true && github.event.inputs.prerelease == false}}
# run: |
# gh release create ${{ steps.create_release_candidate.outputs.version }} \
# --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 && 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 && 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 && github.event.inputs.automatic_mode == true }}
# run: |
# gh pr merge ${{ github.event.inputs.target_branch }} \
# --delete-branch
#

0 comments on commit d7cb10b

Please sign in to comment.