diff --git a/.github/workflows/release-repository.yaml b/.github/workflows/release-repository.yaml index bad7309..695e36a 100644 --- a/.github/workflows/release-repository.yaml +++ b/.github/workflows/release-repository.yaml @@ -2,107 +2,113 @@ name: Release repository on: - workflow_dispatch: - inputs: - target_branch: - description: Target branch for the release. - required: true - version: - description: New version (used for tag). - required: true - date: - description: Date stamp of the image to be used in the compose files. - required: true - release_name: - description: Name of the release to be created. Version in the first place is recommended (e.g. `2.0.0-alpha`). - required: true - automatic_mode: - type: boolean - default: false - description: Automatically merge PR and create release. - prerelease: - type: boolean - default: false - description: Mark the release as a prerelease. + workflow_dispatch: + inputs: + target_branch: + description: Target branch for the release. + required: true + version: + description: New version (used for tag). + required: true + date: + description: Date stamp of the image to be used in the compose files. + required: true + release_name: + description: Name of the release to be created. Version in the first place is recommended (e.g. + `2.0.0-alpha`). + required: true + automatic_mode: + type: boolean + default: false + description: Automatically merge PR and create release. + prerelease: + type: boolean + default: false + description: Mark the release as a prerelease. jobs: - release: - name: Release repository - runs-on: ubuntu-22.04 - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - RELEASE_BRANCH: release-${{ github.event.inputs.version }} - DOCKER_IMAGE_TAG: humble-${{ github.event.inputs.version }}-${{ github.event.inputs.date }}-stable - MAIN_BRANCH: ros2 - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ github.event.inputs.target_branch }} + release: + name: Release repository + runs-on: ubuntu-22.04 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_BRANCH: release-${{ github.event.inputs.version }} + DOCKER_IMAGE_TAG: humble-${{ github.event.inputs.version }}-${{ github.event.inputs.date }}-stable + MAIN_BRANCH: ros2 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.target_branch }} - - name: Update docker image version - uses: mikefarah/yq@v4.43.1 - with: - cmd: | - yq -i '.services.panther_ros.image = "husarion/panther:${{ env.DOCKER_IMAGE_TAG }}" | (... | select(tag == "!!merge")) tag = ""' demo/compose.minimal-setup.yaml - yq -i '.services.panther_gazebo.image = "husarion/panther-gazebo:${{ env.DOCKER_IMAGE_TAG }}" | (... | select(tag == "!!merge")) tag = ""' demo/compose.simulation.yaml + - name: Update docker image version + uses: mikefarah/yq@v4.43.1 + with: + cmd: | + yq -i '.services.panther_ros.image = "husarion/panther:${{ env.DOCKER_IMAGE_TAG }}" | (... | select(tag == "!!merge")) tag = ""' demo/compose.minimal-setup.yaml + yq -i '.services.panther_gazebo.image = "husarion/panther-gazebo:${{ env.DOCKER_IMAGE_TAG }}" | (... | select(tag == "!!merge")) tag = ""' demo/compose.simulation.yaml - - name: Commit changes to release branch - uses: EndBug/add-and-commit@v9 - with: - message: Update docker image version - author_name: action-bot - author_email: action-bot@action-bot.com - new_branch: ${{ env.RELEASE_BRANCH }} + - name: Commit changes to release branch + uses: EndBug/add-and-commit@v9 + with: + message: Update docker image version + author_name: action-bot + author_email: action-bot@action-bot.com + new_branch: ${{ env.RELEASE_BRANCH }} - - name: Create pull request - run: | - gh pr create \ - --base ${{ github.event.inputs.target_branch }} \ - --head $RELEASE_BRANCH \ - --title "Release ${{ github.event.inputs.version }}" \ - --body "This PR incorporates tag(s) update in docker compose files." + - name: Create pull request + run: | + gh pr create \ + --base ${{ github.event.inputs.target_branch }} \ + --head $RELEASE_BRANCH \ + --title "Release ${{ github.event.inputs.version }}" \ + --body "This PR incorporates tag(s) update in docker compose files." - - name: Merge pull request - if: ${{ fromJSON(github.event.inputs.automatic_mode) == true }} - run: | - gh pr merge $RELEASE_BRANCH \ - --merge --delete-branch + - name: Merge pull request + if: ${{ fromJSON(github.event.inputs.automatic_mode) == true }} + run: | + gh pr merge $RELEASE_BRANCH \ + --merge --delete-branch - - 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: 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: | - 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 tag(s) update in docker compose files." + - name: Create pull request to main + 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 ${{ env.MAIN_BRANCH }}" \ + --body "This PR incorporates tag(s) update in docker compose files." - - 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: 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 ${{ github.event.inputs.version }} \ - --target ${{ env.MAIN_BRANCH }} \ - --title ${{ github.event.inputs.release_name }} \ - --generate-notes \ - --prerelease + - name: Create prerelease + if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && fromJSON(github.event.inputs.prerelease) + == true}} + run: | + gh release create ${{ github.event.inputs.version }} \ + --target ${{ env.MAIN_BRANCH }} \ + --title ${{ github.event.inputs.release_name }} \ + --generate-notes \ + --prerelease - - name: Create release - if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && fromJSON(github.event.inputs.prerelease) == false}} - run: | - gh release create ${{ github.event.inputs.version }} \ - --target ${{ env.MAIN_BRANCH }} \ - --title ${{ github.event.inputs.release_name }} \ - --generate-notes + - name: Create release + if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && fromJSON(github.event.inputs.prerelease) + == false}} + run: | + gh release create ${{ github.event.inputs.version }} \ + --target ${{ env.MAIN_BRANCH }} \ + --title ${{ github.event.inputs.release_name }} \ + --generate-notes diff --git a/.github/workflows/ros-docker-image.yaml b/.github/workflows/ros-docker-image.yaml index 08cdcda..2d5b4cd 100644 --- a/.github/workflows/ros-docker-image.yaml +++ b/.github/workflows/ros-docker-image.yaml @@ -2,66 +2,63 @@ name: Build/Publish ROS Docker Image on: - workflow_dispatch: - inputs: - build_type: - description: Is it a "development" or a "stable" release? - required: true - default: development - type: choice - options: - - development - - stable - target_distro: - description: - In case of "stable" release specify the ROS distro of the existing docker image (eg. - humble) - type: string - default: humble - target_release: - description: - In case of "stable" release specify the version of the existing docker image (eg. - 1.0.12) - type: string - default: 0.0.0 - target_date: - description: - In case of "stable" release specify the date of the existing docker image in format - YYYYMMDD (eg. 20220124) - type: string - default: "20131206" + workflow_dispatch: + inputs: + build_type: + description: Is it a "development" or a "stable" release? + required: true + default: development + type: choice + options: + - development + - stable + target_distro: + description: In case of "stable" release specify the ROS distro of the existing docker image (eg. + humble) + type: string + default: humble + target_release: + description: In case of "stable" release specify the version of the existing docker image (eg. + 1.0.12) + type: string + default: 0.0.0 + target_date: + description: In case of "stable" release specify the date of the existing docker image in format + YYYYMMDD (eg. 20220124) + type: string + default: '20131206' jobs: - build: - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - include: - - dockerfile: Dockerfile.hardware - platforms: linux/arm64 - ros_distro: humble - - dockerfile: Dockerfile.simulation - repo_name: panther-gazebo - platforms: linux/amd64 - ros_distro: humble + build: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + include: + - dockerfile: Dockerfile.hardware + platforms: linux/arm64 + ros_distro: humble + - dockerfile: Dockerfile.simulation + repo_name: panther-gazebo + platforms: linux/amd64 + ros_distro: humble - steps: - - name: Checkout - uses: actions/checkout@v2 + steps: + - name: Checkout + uses: actions/checkout@v2 - - name: Build Docker Image - uses: husarion-ci/ros-docker-img-action@v0.5 - with: - dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} - dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} - main_branch_name: ros2 - dockerfile: ${{ matrix.dockerfile }} - repo_name: ${{ matrix.repo_name }} - build_type: ${{ inputs.build_type }} - ros_distro: ${{ matrix.ros_distro }} - platforms: ${{ matrix.platforms }} + - name: Build Docker Image + uses: husarion-ci/ros-docker-img-action@v0.5 + with: + dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} + main_branch_name: ros2 + dockerfile: ${{ matrix.dockerfile }} + repo_name: ${{ matrix.repo_name }} + build_type: ${{ inputs.build_type }} + ros_distro: ${{ matrix.ros_distro }} + platforms: ${{ matrix.platforms }} # variables important only for stable release - target_distro: ${{ inputs.target_distro }} - target_release: ${{ inputs.target_release }} - target_date: ${{ inputs.target_date }} + target_distro: ${{ inputs.target_distro }} + target_release: ${{ inputs.target_release }} + target_date: ${{ inputs.target_date }} diff --git a/demo/compose.minimal-setup.yaml b/demo/compose.minimal-setup.yaml index 821b68f..49a779f 100644 --- a/demo/compose.minimal-setup.yaml +++ b/demo/compose.minimal-setup.yaml @@ -40,4 +40,3 @@ services: stop_signal: SIGINT command: > bash -c "ros2 launch joy2twist gamepad_controller.launch.py joy2twist_params_file:=$(ros2 pkg prefix joy2twist)/share/joy2twist/config/joy2twist_panther.yaml namespace:=panther" - diff --git a/demo/compose.simulation.yaml b/demo/compose.simulation.yaml index 9d01439..c2fc715 100644 --- a/demo/compose.simulation.yaml +++ b/demo/compose.simulation.yaml @@ -20,4 +20,3 @@ services: - /tmp/.X11-unix:/tmp/.X11-unix:rw command: > ros2 launch panther_gazebo simulation.launch.py -