Conda Packages #9
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: Conda Packages | |
| on: | |
| push: | |
| tags: ['*'] | |
| workflow_dispatch: | |
| inputs: | |
| ros_distro: | |
| description: 'ROS distro to build (leave empty for all)' | |
| required: false | |
| type: choice | |
| options: | |
| - all | |
| - humble | |
| - jazzy | |
| - kilted | |
| default: all | |
| permissions: | |
| contents: read | |
| id-token: write # Required for OIDC trusted publishing | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| setup: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.set.outputs.matrix }} | |
| steps: | |
| - id: set | |
| run: | | |
| if [[ "$DISTRO" == "all" || -z "$DISTRO" ]]; then | |
| echo 'matrix={"include":[{"ros_distro":"humble","robostack_channel":"robostack-humble"},{"ros_distro":"jazzy","robostack_channel":"robostack-jazzy"},{"ros_distro":"kilted","robostack_channel":"robostack-kilted"}]}' >> "$GITHUB_OUTPUT" | |
| else | |
| echo "matrix={\"include\":[{\"ros_distro\":\"$DISTRO\",\"robostack_channel\":\"robostack-$DISTRO\"}]}" >> "$GITHUB_OUTPUT" | |
| fi | |
| env: | |
| DISTRO: ${{ inputs.ros_distro }} | |
| build: | |
| needs: setup | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJson(needs.setup.outputs.matrix) }} | |
| runs-on: ubuntu-latest | |
| name: conda-${{ matrix.ros_distro }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build conda package | |
| uses: prefix-dev/rattler-build-action@v0.2.36 | |
| with: | |
| recipe-path: conda.recipe/recipe.yaml | |
| artifact-name: conda-${{ matrix.ros_distro }} | |
| build-args: > | |
| --variant ros_distro=${{ matrix.ros_distro }} | |
| -c ${{ matrix.robostack_channel }} | |
| -c conda-forge | |
| publish: | |
| name: Upload to prefix.dev | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: prefix-dev/rattler-build-action@v0.2.36 | |
| with: | |
| setup-only: true | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| pattern: conda-* | |
| merge-multiple: false | |
| - name: Upload to prefix.dev | |
| shell: bash | |
| run: | | |
| shopt -s nullglob globstar | |
| EXIT_CODE=0 | |
| for pkg in artifacts/**/*.conda artifacts/**/*.tar.bz2; do | |
| echo "Uploading ${pkg}" | |
| if ! rattler-build upload prefix -c plotjuggler "${pkg}"; then | |
| EXIT_CODE=1 | |
| fi | |
| done | |
| exit $EXIT_CODE |