Skip to content

Commit

Permalink
Adds macos runner to create arm64 build and merges manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
dsobek committed Sep 16, 2024
1 parent 336c424 commit dd24574
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
25 changes: 24 additions & 1 deletion .github/workflows/earthly-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:
path: log/build_results_archives/${{env.archivename}}
if-no-files-found: error
space-ros-image:
outputs:
output_ubuntu: ${{steps.push_image.outputs.output_ubuntu-latest}}
output_macos: ${{steps.push_image.outputs.output_macos-14}}
strategy:
matrix:
include:
Expand All @@ -41,6 +44,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install prerequisites
if: ${{ startsWith(matrix.os, 'macos') }}
run: |
brew install --cask docker
- name: Set up earthly
run: |
sudo wget https://github.com/earthly/earthly/releases/latest/download/${{matrix.earthly}} -O /usr/local/bin/earthly
Expand All @@ -50,9 +57,25 @@ jobs:
earthly --ci --output +sources
earthly --ci +image
- name: Push spaceros image
id: push_image
env:
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_RW_TOKEN }}
IMG_NAME: osrf/space-ros
TAG: ${{ github.ref_name }}-${{ runner.arch }}
if: ${{ github.ref_type == 'tag' }}
run: |
echo $DOCKER_HUB_TOKEN | docker login --username osrfbot --password-stdin
earthly --ci --push +image --tag=${{ github.ref_name }}
earthly --ci --push +image --img_name=$IMG_NAME --tag=$TAG
echo "output_${{ matrix.os }}=${IMG_NAME}:${TAG}" >> "$GITHUB_OUTPUT"
combine-manifests:
runs-on: ubuntu-latest
needs: space-ros-image
steps:
- name: Combine Manifests
env:
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_RW_TOKEN }}
- run: |
echo $DOCKER_HUB_TOKEN | docker login --username osrfbot --password-stdin
docker manifest create osrf/space-ros \
--amend ${{ join(needs.space-ros-image.outputs, ' --amend ') }}
docker manifest push osrf/space-ros:${{ github.ref_name }}
3 changes: 2 additions & 1 deletion Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ build-testing:
image:
FROM +rosdep
ARG VCS_REF
ARG img_name='osrf/space-ros'
ARG tag='latest'

# Specify the docker image metadata
Expand All @@ -276,4 +277,4 @@ image:
COPY docker/entrypoint.sh /ros_entrypoint.sh
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["bash"]
SAVE IMAGE --push osrf/space-ros:latest osrf/space-ros:$tag
SAVE IMAGE --push $img_name:latest $img_name:$tag

0 comments on commit dd24574

Please sign in to comment.