try gitlab workflows after migration #21
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Generate Debian Packages | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| types: [ opened, synchronize, reopened, ready_for_review ] | |
| workflow_dispatch: # Manual trigger | |
| inputs: | |
| ros_distros: | |
| description: 'ROS distributions to build (comma-separated: humble,iron,jazzy,kilted,rolling)' | |
| required: false | |
| default: 'humble,jazzy' | |
| schedule: | |
| - cron: '0 2 * * *' # Nightly at 2 AM UTC | |
| env: | |
| ROS_LOCALHOST_ONLY: 1 | |
| ROS_AUTOMATIC_DISCOVERY_RANGE: LOCALHOST | |
| jobs: | |
| determine-distros: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| distros: ${{ steps.set-distros.outputs.distros }} | |
| steps: | |
| - name: Determine ROS distributions to build | |
| id: set-distros | |
| run: | | |
| if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | |
| # Manual trigger - use input or default | |
| DISTROS="${{ github.event.inputs.ros_distros || 'humble,iron,jazzy,kilted,rolling' }}" | |
| else | |
| # Always build all distributions | |
| DISTROS="humble,iron,jazzy,kilted,rolling" | |
| fi | |
| echo "Building for distributions: $DISTROS" | |
| # Convert to JSON array for matrix | |
| JSON_ARRAY=$(echo "$DISTROS" | jq -R -c 'split(",") | map(select(length > 0))') | |
| echo "distros=$JSON_ARRAY" >> $GITHUB_OUTPUT | |
| generate-debian: | |
| name: Generate Debian packages for ROS2 ${{ matrix.ros_distro }} | |
| runs-on: ubuntu-latest | |
| needs: [determine-distros] | |
| container: | |
| image: ros:${{ matrix.ros_distro }}-ros-base-${{ matrix.ubuntu_distro }} | |
| credentials: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ros_distro: ${{ fromJson(needs.determine-distros.outputs.distros) }} | |
| include: | |
| - ros_distro: humble | |
| ubuntu_distro: jammy | |
| - ros_distro: iron | |
| ubuntu_distro: jammy | |
| - ros_distro: jazzy | |
| ubuntu_distro: noble | |
| - ros_distro: kilted | |
| ubuntu_distro: noble | |
| - ros_distro: rolling | |
| ubuntu_distro: noble | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Build Debian packages | |
| run: | | |
| chmod +x scripts/build_debian_packages.sh | |
| ./scripts/build_debian_packages.sh ${{ matrix.ros_distro }} ${{ matrix.ubuntu_distro }} | |
| shell: bash | |
| - name: Upload Debian packages | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: debian-packages-${{ matrix.ros_distro }} | |
| path: debian_packages/${{ matrix.ros_distro }}/ | |
| retention-days: 30 |