@@ -21,156 +21,156 @@ env:
2121 DOCKER_HUB_IMAGE_NAME : " osrf/space-ros"
2222
2323jobs :
24- build-test :
25- runs-on : ubuntu-latest
26- steps :
27- - name : Checkout
28- uses : actions/checkout@v3
29- - name : Set up earthly
30- run : |
31- sudo wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly
32- sudo chmod 755 /usr/local/bin/earthly
33- - name : Build Test Space ROS
34- id : build
35- run : |
36- earthly --ci --output +build-test
37- echo "archivename=$(basename log/build_results_archives/build_results_*.tar.bz2)" >> $GITHUB_ENV
38- - name : Upload build results archive
39- uses : actions/upload-artifact@v4
40- with :
41- name : ${{env.archivename}}
42- path : log/build_results_archives/${{env.archivename}}
43- if-no-files-found : error
44-
45- define-architecture-matrix :
46- runs-on : ubuntu-latest
47- outputs :
48- architecture-matrix : ${{ steps.define-matrix.arch-matrix}}
49- steps :
50- - id : define-matrix
51- run : |
52- echo 'arch-matrix=[{"runner": "ubuntu-latest", "arch": "amd64"}, {"runner": "ubuntu-20.04-arm", "arch": "arm64"},]' >> "$GITHUB_OUTPUT"
53-
54- space-ros-main-image :
55- needs : define-architecture-matrix
56- strategy :
57- matrix :
58- arch-info : ${{ fromJSON(needs.define-architecture-matrix.outputs.architecture-matrix) }}
59- # Keep in sync with the architecture-matrix arch values.
60- outputs :
61- output_amd64 : ${{ steps.push_image.outputs.output_amd64 }}
62- output_arm64 : ${{ steps.push_image.outputs.output_arm64 }}
63- runs-on : ${{ matrix.arch-info.runner }}
64- env :
65- ARCH_IMAGE_TAG : " ${{ github.head_ref || github.ref_name }}-${{ matrix.arch-info.arch }}"
66-
67- steps :
68- - name : Checkout
69- uses : actions/checkout@v3
70-
71- - name : Set up earthly
72- run : |
73- sudo wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-${{ matrix.arch-info.arch }} -O /usr/local/bin/earthly
74- sudo chmod 755 /usr/local/bin/earthly
75-
76- - name : Login to Docker Hub
77- uses : docker/login-action@v3
78- with :
79- username : ${{ env.DOCKER_HUB_USERNAME }}
80- password : ${{ env.DOCKER_HUB_TOKEN }}
81-
82- - name : Build spaceros image and push it to Dockerhub
83- id : push_image
84- run : |
85- earthly --ci --output +push-main-image \
86- --VCS_REF="$VCS_REF" \
87- --IMAGE_TAG="$ARCH_IMAGE_TAG" \
88- --IMAGE_NAME="$DOCKER_HUB_IMAGE_NAME"
89- echo "output_${{ matrix.arch-info.arch }}=$DOCKER_HUB_IMAGE_NAME:$ARCH_IMAGE_TAG" >> "$GITHUB_OUTPUT"
90-
91- # Login and push the main builds to GHCR
92- - name : Login to GHCR
93- uses : docker/login-action@v3
94- if : ${{ github.ref_name == 'main' }}
95- with :
96- registry : ghcr.io
97- username : ${{ github.actor }}
98- password : ${{ secrets.GITHUB_TOKEN }}
99-
100- - name : Push the main spaceros image to GHCR
101- if : ${{ github.ref_name == 'main' }}
102- run : |
103- docker tag "$DOCKER_HUB_IMAGE_NAME:$ARCH_IMAGE_TAG" "$GHCR_IMAGE_NAME:$ARCH_IMAGE_TAG"
104- docker push "$GHCR_IMAGE_NAME:$ARCH_IMAGE_TAG"
105-
106-
107- combine-main-image-manifests :
108- env :
109- IMAGE_TAG : " ${{ github.head_ref || github.ref_name }}"
110-
111- runs-on : ubuntu-latest
112- needs : space-ros-main-image
113- steps :
114- - name : Login to Docker Hub
115- uses : docker/login-action@v3
116- with :
117- username : ${{ env.DOCKER_HUB_USERNAME }}
118- password : ${{ env.DOCKER_HUB_TOKEN }}
119-
120- - name : Combine Manifests
121- run : |
122- docker manifest create osrf/space-ros:${{ github.ref_name }} \
123- --amend ${{ join(needs.space-ros-main-image.outputs, ' --amend ') }}
124- docker manifest push $DOCKER_HUB_IMAGE_NAME:$IMAGE_TAG
125-
126- # Any tagged image should also be marked as "latest"
127- - name : Push spaceros latest images to Dockerhub
128- if : ${{ github.ref_type == 'tag' }}
129- run : |
130- # We must login using the password and not the action, as the action only supports tokens.
131- docker tag "$DOCKER_HUB_IMAGE_NAME:$IMAGE_TAG" "$DOCKER_HUB_IMAGE_NAME:latest"
132- docker push "$DOCKER_HUB_IMAGE_NAME:latest"
133-
134- space-ros-dev-image :
135- runs-on : ubuntu-latest
136- env :
137- IMAGE_TAG : " ${{ github.head_ref || github.ref_name }}-dev"
138-
139- steps :
140- - name : Checkout
141- uses : actions/checkout@v3
142-
143- - name : Set up earthly
144- run : |
145- sudo wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly
146- sudo chmod 755 /usr/local/bin/earthly
147-
148- - name : Build spaceros dev image without pushing
149- run : |
150- earthly --ci --output +push-dev-image \
151- --VCS_REF="$VCS_REF" \
152- --IMAGE_TAG="$IMAGE_TAG" \
153- --IMAGE_NAME="$DOCKER_HUB_IMAGE_NAME"
154-
155- - name : Login to GHCR
156- uses : docker/login-action@v3
157- if : ${{ github.ref_name == 'main' }}
158- with :
159- registry : ghcr.io
160- username : ${{ github.actor }}
161- password : ${{ secrets.GITHUB_TOKEN }}
162-
163- # Only push the main dev builds to GHCR
164- - name : Push the dev spaceros image to GHCR
165- if : ${{ github.ref_name == 'main' }}
166- run : |
167- docker tag "$DOCKER_HUB_IMAGE_NAME:$IMAGE_TAG" "$GHCR_IMAGE_NAME:$IMAGE_TAG"
168- docker push "$GHCR_IMAGE_NAME:$IMAGE_TAG"
169-
170- # Push both tagged releases and the main dev builds to Dockerhub
171- - name : Push spaceros images to Dockerhub
172- if : ${{ github.ref_type == 'tag' || github.ref_name == 'main' }}
173- run : |
174- # We must login using the password and not the action, as the action only supports tokens.
175- echo "$DOCKER_HUB_TOKEN" | docker login --username "$DOCKER_HUB_USERNAME" --password-stdin
176- docker push "$DOCKER_HUB_IMAGE_NAME:$IMAGE_TAG"
24+ # build-test:
25+ # runs-on: ubuntu-latest
26+ # steps:
27+ # - name: Checkout
28+ # uses: actions/checkout@v3
29+ # - name: Set up earthly
30+ # run: |
31+ # sudo wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly
32+ # sudo chmod 755 /usr/local/bin/earthly
33+ # - name: Build Test Space ROS
34+ # id: build
35+ # run: |
36+ # earthly --ci --output +build-test
37+ # echo "archivename=$(basename log/build_results_archives/build_results_*.tar.bz2)" >> $GITHUB_ENV
38+ # - name: Upload build results archive
39+ # uses: actions/upload-artifact@v4
40+ # with:
41+ # name: ${{env.archivename}}
42+ # path: log/build_results_archives/${{env.archivename}}
43+ # if-no-files-found: error
44+ #
45+ # define-architecture-matrix:
46+ # runs-on: ubuntu-latest
47+ # outputs:
48+ # architecture-matrix: ${{ steps.define-matrix.arch-matrix}}
49+ # steps:
50+ # - id: define-matrix
51+ # run: |
52+ # echo 'arch-matrix=[{"runner": "ubuntu-latest", "arch": "amd64"}, {"runner": "ubuntu-20.04-arm", "arch": "arm64"},]' >> "$GITHUB_OUTPUT"
53+ #
54+ # space-ros-main-image:
55+ # needs: define-architecture-matrix
56+ # strategy:
57+ # matrix:
58+ # arch-info: ${{ fromJSON(needs.define-architecture-matrix.outputs.architecture-matrix) }}
59+ # # Keep in sync with the architecture-matrix arch values.
60+ # outputs:
61+ # output_amd64: ${{ steps.push_image.outputs.output_amd64 }}
62+ # output_arm64: ${{ steps.push_image.outputs.output_arm64 }}
63+ # runs-on: ${{ matrix.arch-info.runner }}
64+ # env:
65+ # ARCH_IMAGE_TAG: "${{ github.head_ref || github.ref_name }}-${{ matrix.arch-info.arch }}"
66+ #
67+ # steps:
68+ # - name: Checkout
69+ # uses: actions/checkout@v3
70+ #
71+ # - name: Set up earthly
72+ # run: |
73+ # sudo wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-${{ matrix.arch-info.arch }} -O /usr/local/bin/earthly
74+ # sudo chmod 755 /usr/local/bin/earthly
75+ #
76+ # - name: Login to Docker Hub
77+ # uses: docker/login-action@v3
78+ # with:
79+ # username: ${{ env.DOCKER_HUB_USERNAME }}
80+ # password: ${{ env.DOCKER_HUB_TOKEN }}
81+ #
82+ # - name: Build spaceros image and push it to Dockerhub
83+ # id: push_image
84+ # run: |
85+ # earthly --ci --output +push-main-image \
86+ # --VCS_REF="$VCS_REF" \
87+ # --IMAGE_TAG="$ARCH_IMAGE_TAG" \
88+ # --IMAGE_NAME="$DOCKER_HUB_IMAGE_NAME"
89+ # echo "output_${{ matrix.arch-info.arch }}=$DOCKER_HUB_IMAGE_NAME:$ARCH_IMAGE_TAG" >> "$GITHUB_OUTPUT"
90+ #
91+ # # Login and push the main builds to GHCR
92+ # - name: Login to GHCR
93+ # uses: docker/login-action@v3
94+ # if: ${{ github.ref_name == 'main' }}
95+ # with:
96+ # registry: ghcr.io
97+ # username: ${{ github.actor }}
98+ # password: ${{ secrets.GITHUB_TOKEN }}
99+ #
100+ # - name: Push the main spaceros image to GHCR
101+ # if: ${{ github.ref_name == 'main' }}
102+ # run: |
103+ # docker tag "$DOCKER_HUB_IMAGE_NAME:$ARCH_IMAGE_TAG" "$GHCR_IMAGE_NAME:$ARCH_IMAGE_TAG"
104+ # docker push "$GHCR_IMAGE_NAME:$ARCH_IMAGE_TAG"
105+ #
106+ #
107+ # combine-main-image-manifests:
108+ # env:
109+ # IMAGE_TAG: "${{ github.head_ref || github.ref_name }}"
110+ #
111+ # runs-on: ubuntu-latest
112+ # needs: space-ros-main-image
113+ # steps:
114+ # - name: Login to Docker Hub
115+ # uses: docker/login-action@v3
116+ # with:
117+ # username: ${{ env.DOCKER_HUB_USERNAME }}
118+ # password: ${{ env.DOCKER_HUB_TOKEN }}
119+ #
120+ # - name: Combine Manifests
121+ # run: |
122+ # docker manifest create osrf/space-ros:${{ github.ref_name }} \
123+ # --amend ${{ join(needs.space-ros-main-image.outputs, ' --amend ') }}
124+ # docker manifest push $DOCKER_HUB_IMAGE_NAME:$IMAGE_TAG
125+ #
126+ # # Any tagged image should also be marked as "latest"
127+ # - name: Push spaceros latest images to Dockerhub
128+ # if: ${{ github.ref_type == 'tag' }}
129+ # run: |
130+ # # We must login using the password and not the action, as the action only supports tokens.
131+ # docker tag "$DOCKER_HUB_IMAGE_NAME:$IMAGE_TAG" "$DOCKER_HUB_IMAGE_NAME:latest"
132+ # docker push "$DOCKER_HUB_IMAGE_NAME:latest"
133+ #
134+ # space-ros-dev-image:
135+ # runs-on: ubuntu-latest
136+ # env:
137+ # IMAGE_TAG: "${{ github.head_ref || github.ref_name }}-dev"
138+ #
139+ # steps:
140+ # - name: Checkout
141+ # uses: actions/checkout@v3
142+ #
143+ # - name: Set up earthly
144+ # run: |
145+ # sudo wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly
146+ # sudo chmod 755 /usr/local/bin/earthly
147+ #
148+ # - name: Build spaceros dev image without pushing
149+ # run: |
150+ # earthly --ci --output +push-dev-image \
151+ # --VCS_REF="$VCS_REF" \
152+ # --IMAGE_TAG="$IMAGE_TAG" \
153+ # --IMAGE_NAME="$DOCKER_HUB_IMAGE_NAME"
154+ #
155+ # - name: Login to GHCR
156+ # uses: docker/login-action@v3
157+ # if: ${{ github.ref_name == 'main' }}
158+ # with:
159+ # registry: ghcr.io
160+ # username: ${{ github.actor }}
161+ # password: ${{ secrets.GITHUB_TOKEN }}
162+ #
163+ # # Only push the main dev builds to GHCR
164+ # - name: Push the dev spaceros image to GHCR
165+ # if: ${{ github.ref_name == 'main' }}
166+ # run: |
167+ # docker tag "$DOCKER_HUB_IMAGE_NAME:$IMAGE_TAG" "$GHCR_IMAGE_NAME:$IMAGE_TAG"
168+ # docker push "$GHCR_IMAGE_NAME:$IMAGE_TAG"
169+ #
170+ # # Push both tagged releases and the main dev builds to Dockerhub
171+ # - name: Push spaceros images to Dockerhub
172+ # if: ${{ github.ref_type == 'tag' || github.ref_name == 'main' }}
173+ # run: |
174+ # # We must login using the password and not the action, as the action only supports tokens.
175+ # echo "$DOCKER_HUB_TOKEN" | docker login --username "$DOCKER_HUB_USERNAME" --password-stdin
176+ # docker push "$DOCKER_HUB_IMAGE_NAME:$IMAGE_TAG"
0 commit comments