Skip to content

Release Panther project #49

Release Panther project

Release Panther project #49

---
name: Release Panther project
on:
workflow_dispatch:
inputs:
version:
description: Release version, must match release candidate version. IMPORTANT - required format
`X.X.X`, (e.g. `2.0.1`).
required: true
date:
description: Release date stamp, must match release candidate date. IMPORTANT - required format
`YYYYMMDD`, (e.g. `20240430`).
required: true
release_name:
description: Name of the release to be created. Version in the first place is recommended (e.g.
`2.0.1-alpha`).
required: true
automatic_mode:
type: boolean
default: false
description: Automatically merge PRs, create releases and build images.
prerelease:
type: boolean
default: false
description: Mark the release as a prerelease.
env:
RC_BRANCH_NAME: ${{ github.event.inputs.version }}-${{ github.event.inputs.date }}
MAIN_BRANCH: ros2
jobs:
release_panther_msgs:
name: Release panther_msgs repository
runs-on: ubuntu-22.04
steps:
- name: Trigger repository release workflow
uses: convictional/[email protected]
with:
owner: husarion
repo: panther_msgs
github_token: ${{ secrets.GH_PAT }}
workflow_file_name: release-repository.yaml
ref: ${{ env.RC_BRANCH_NAME }}
wait_interval: 10
client_payload: |
{
"release_candidate": "${{ env.RC_BRANCH_NAME }}",
"version": "${{ github.event.inputs.version }}",
"release_name": "${{ github.event.inputs.release_name }}",
"automatic_mode": "${{ github.event.inputs.automatic_mode }}",
"prerelease": "${{ github.event.inputs.prerelease }}"
}
release_panther_ros:
name: Release panther_ros repository
needs:
- release_panther_msgs
runs-on: ubuntu-22.04
steps:
- name: Trigger panther_ros release workflow
uses: convictional/[email protected]
with:
owner: husarion
repo: panther_ros
github_token: ${{ secrets.GITHUB_TOKEN }} # Use the default GITHUB_TOKEN for local repository
workflow_file_name: release-repository.yaml
ref: ${{ env.RC_BRANCH_NAME }}
wait_interval: 10
client_payload: |
{
"release_candidate": "${{ env.RC_BRANCH_NAME }}",
"version": "${{ github.event.inputs.version }}",
"release_name": "${{ github.event.inputs.release_name }}",
"automatic_mode": "${{ github.event.inputs.automatic_mode }}",
"prerelease": "${{ github.event.inputs.prerelease }}"
}
rebuild_and_push_docker_images:
name: Rebuild panther docker images with new version
runs-on: ubuntu-22.04
needs:
- release_panther_ros
steps:
- name: Trigger repository build workflow
uses: convictional/[email protected]
with:
owner: husarion
repo: panther-docker
github_token: ${{ secrets.GH_PAT }}
workflow_file_name: ros-docker-image.yaml
ref: ${{ env.RC_BRANCH_NAME }}
wait_interval: 10
client_payload: |
{
"build_type": "development",
"target_distro": "humble"
}
release_panther_docker:
name: Release panther-docker repository
needs:
- rebuild_and_push_docker_images
runs-on: ubuntu-22.04
steps:
- name: Trigger repository release workflow
uses: convictional/[email protected]
with:
owner: husarion
repo: panther-docker
github_token: ${{ secrets.GH_PAT }}
workflow_file_name: release-repository.yaml
ref: ${{ env.RC_BRANCH_NAME }}
wait_interval: 10
client_payload: |
{
"release_candidate": "${{ env.RC_BRANCH_NAME }}",
"version": "${{ github.event.inputs.version }}",
"release_name": "${{ github.event.inputs.release_name }}",
"automatic_mode": "${{ github.event.inputs.automatic_mode }}",
"prerelease": "${{ github.event.inputs.prerelease }}"
}
release_panther_rpi_os_image:
name: Release panther-rpi-os-img repository
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true }}
needs:
- release_panther_docker
runs-on: ubuntu-22.04
steps:
- name: Trigger repository release workflow
uses: convictional/[email protected]
with:
owner: husarion
repo: panther-rpi-os-img
github_token: ${{ secrets.GH_PAT }}
workflow_file_name: release-repository.yaml
ref: ${{ env.RC_BRANCH_NAME }}
wait_interval: 10
client_payload: |
{
"release_candidate": "${{ env.RC_BRANCH_NAME }}",
"version": "${{ github.event.inputs.version }}",
"release_name": "${{ github.event.inputs.release_name }}",
"automatic_mode": "${{ github.event.inputs.automatic_mode }}",
"prerelease": "${{ github.event.inputs.prerelease }}"
}
build_and_publish_rpi_image:
name: Build panther system image
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true }}
needs:
- release_panther_rpi_os_image
runs-on: ubuntu-22.04
steps:
- name: Trigger repository build workflow
uses: convictional/[email protected]
with:
owner: husarion
repo: panther-rpi-os-img
github_token: ${{ secrets.GH_PAT }}
workflow_file_name: build_and_deploy_image.yaml
ref: ${{ env.MAIN_BRANCH }}
wait_interval: 10
client_payload: |
{
"dev_image": "false",
"panther_codebase_version": "${{ github.event.inputs.version }}",
"image_tag": "${{ github.event.inputs.version }}"
}