Skip to content

Commit cfea35e

Browse files
committed
fix syntax
1 parent 630aa63 commit cfea35e

File tree

1 file changed

+94
-94
lines changed

1 file changed

+94
-94
lines changed

.github/workflows/release.yaml

Lines changed: 94 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -214,100 +214,100 @@ jobs:
214214
# Docker images (amd64 + arm64)
215215
# ---------------------------
216216
docker:
217-
runs-on: ubuntu-latest
218-
needs: [gh-release] # assets exist on the release
219-
steps:
220-
- uses: actions/checkout@v5
221-
222-
- name: Compute tags
223-
id: tags
224-
shell: bash
225-
run: |
226-
set -euo pipefail
227-
V="${{ github.ref_name }}"; V="${V#v}"
228-
IFS='.' read -r MAJOR MINOR PATCH <<< "$V"
229-
echo "version=$V" >> $GITHUB_OUTPUT
230-
echo "major=$MAJOR" >> $GITHUB_OUTPUT
231-
echo "minor=${MAJOR}.${MINOR}" >> $GITHUB_OUTPUT
232-
echo "patch=${MAJOR}.${MINOR}.${PATCH}" >> $GITHUB_OUTPUT
233-
234-
- name: Prep buildx
235-
uses: docker/setup-buildx-action@v3
236-
with: { install: true }
237-
238-
- name: Login Docker Hub
239-
uses: docker/login-action@v3
240-
with:
241-
registry: docker.io
242-
username: ${{ secrets.DOCKERHUB_USER }}
243-
password: ${{ secrets.DOCKERHUB_PASSWORD }}
244-
245-
# --- Build amd64 (pull binaries from the GitHub Release) ---
246-
- name: Fetch linux/amd64 binaries
247-
run: |
248-
set -euxo pipefail
249-
BASE="https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}"
250-
mkdir -p dockerctx
251-
curl -sSL "${BASE}/preflight_linux_amd64.tar.gz" | tar -xz -C dockerctx preflight
252-
curl -sSL "${BASE}/support-bundle_linux_amd64.tar.gz" | tar -xz -C dockerctx support-bundle
253-
254-
- name: Build & push amd64 images
255-
run: |
256-
set -euxo pipefail
257-
cp deploy/Dockerfile.troubleshoot dockerctx/Dockerfile
258-
docker buildx build \
259-
--platform linux/amd64 \
260-
--build-arg VERSION=${{ steps.tags.outputs.version }} \
261-
--build-arg COMMIT=${{ github.sha }} \
262-
--build-arg DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ) \
263-
-t replicated/troubleshoot:${{ steps.tags.outputs.patch }}-amd64 \
264-
-t replicated/preflight:${{ steps.tags.outputs.patch }}-amd64 \
265-
--push dockerctx
266-
267-
# --- Build arm64 ---
268-
- name: Fetch linux/arm64 binaries
269-
run: |
270-
set -euxo pipefail
271-
BASE="https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}"
272-
rm -rf dockerctx && mkdir -p dockerctx
273-
curl -sSL "${BASE}/preflight_linux_arm64.tar.gz" | tar -xz -C dockerctx preflight
274-
curl -sSL "${BASE}/support-bundle_linux_arm64.tar.gz" | tar -xz -C dockerctx support-bundle
275-
276-
- name: Build & push arm64 images
277-
run: |
278-
set -euxo pipefail
279-
cp deploy/Dockerfile.troubleshoot dockerctx/Dockerfile
280-
docker buildx build \
281-
--platform linux/arm64 \
282-
--build-arg VERSION=${{ steps.tags.outputs.version }} \
283-
--build-arg COMMIT=${{ github.sha }} \
284-
--build-arg DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ) \
285-
-t replicated/troubleshoot:${{ steps.tags.outputs.patch }}-arm64 \
286-
-t replicated/preflight:${{ steps.tags.outputs.patch }}-arm64 \
287-
--push dockerctx
288-
289-
# --- Create multi-arch manifests for each tag line ---
290-
- name: Create and push manifests
291-
shell: bash
292-
run: |
293-
set -euxo pipefail
294-
mk_manifest() {
295-
local repo="$1"; local tag="$2"
296-
docker buildx imagetools create \
297-
-t ${repo}:${tag} \
298-
${repo}:${{ steps.tags.outputs.patch }}-amd64 \
299-
${repo}:${{ steps.tags.outputs.patch }}-arm64
300-
}
301-
# patch tag already exists per-arch; aggregate into MAJOR.MINOR.PATCH, MAJOR.MINOR, MAJOR, latest
302-
mk_manifest replicated/troubleshoot ${{ steps.tags.outputs.patch }}
303-
mk_manifest replicated/troubleshoot ${{ steps.tags.outputs.minor }}
304-
mk_manifest replicated/troubleshoot ${{ steps.tags.outputs.major }}
305-
mk_manifest replicated/troubleshoot latest
306-
307-
mk_manifest replicated/preflight ${{ steps.tags.outputs.patch }}
308-
mk_manifest replicated/preflight ${{ steps.tags.outputs.minor }}
309-
mk_manifest replicated/preflight ${{ steps.tags.outputs.major }}
310-
mk_manifest replicated/preflight latest
217+
runs-on: ubuntu-latest
218+
needs: [gh-release] # assets exist on the release
219+
steps:
220+
- uses: actions/checkout@v5
221+
222+
- name: Compute tags
223+
id: tags
224+
shell: bash
225+
run: |
226+
set -euo pipefail
227+
V="${{ github.ref_name }}"; V="${V#v}"
228+
IFS='.' read -r MAJOR MINOR PATCH <<< "$V"
229+
echo "version=$V" >> $GITHUB_OUTPUT
230+
echo "major=$MAJOR" >> $GITHUB_OUTPUT
231+
echo "minor=${MAJOR}.${MINOR}" >> $GITHUB_OUTPUT
232+
echo "patch=${MAJOR}.${MINOR}.${PATCH}" >> $GITHUB_OUTPUT
233+
234+
- name: Prep buildx
235+
uses: docker/setup-buildx-action@v3
236+
with: { install: true }
237+
238+
- name: Login Docker Hub
239+
uses: docker/login-action@v3
240+
with:
241+
registry: docker.io
242+
username: ${{ secrets.DOCKERHUB_USER }}
243+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
244+
245+
# --- Build amd64 (pull binaries from the GitHub Release) ---
246+
- name: Fetch linux/amd64 binaries
247+
run: |
248+
set -euxo pipefail
249+
BASE="https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}"
250+
mkdir -p dockerctx
251+
curl -sSL "${BASE}/preflight_linux_amd64.tar.gz" | tar -xz -C dockerctx preflight
252+
curl -sSL "${BASE}/support-bundle_linux_amd64.tar.gz" | tar -xz -C dockerctx support-bundle
253+
254+
- name: Build & push amd64 images
255+
run: |
256+
set -euxo pipefail
257+
cp deploy/Dockerfile.troubleshoot dockerctx/Dockerfile
258+
docker buildx build \
259+
--platform linux/amd64 \
260+
--build-arg VERSION=${{ steps.tags.outputs.version }} \
261+
--build-arg COMMIT=${{ github.sha }} \
262+
--build-arg DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ) \
263+
-t replicated/troubleshoot:${{ steps.tags.outputs.patch }}-amd64 \
264+
-t replicated/preflight:${{ steps.tags.outputs.patch }}-amd64 \
265+
--push dockerctx
266+
267+
# --- Build arm64 ---
268+
- name: Fetch linux/arm64 binaries
269+
run: |
270+
set -euxo pipefail
271+
BASE="https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}"
272+
rm -rf dockerctx && mkdir -p dockerctx
273+
curl -sSL "${BASE}/preflight_linux_arm64.tar.gz" | tar -xz -C dockerctx preflight
274+
curl -sSL "${BASE}/support-bundle_linux_arm64.tar.gz" | tar -xz -C dockerctx support-bundle
275+
276+
- name: Build & push arm64 images
277+
run: |
278+
set -euxo pipefail
279+
cp deploy/Dockerfile.troubleshoot dockerctx/Dockerfile
280+
docker buildx build \
281+
--platform linux/arm64 \
282+
--build-arg VERSION=${{ steps.tags.outputs.version }} \
283+
--build-arg COMMIT=${{ github.sha }} \
284+
--build-arg DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ) \
285+
-t replicated/troubleshoot:${{ steps.tags.outputs.patch }}-arm64 \
286+
-t replicated/preflight:${{ steps.tags.outputs.patch }}-arm64 \
287+
--push dockerctx
288+
289+
# --- Create multi-arch manifests for each tag line ---
290+
- name: Create and push manifests
291+
shell: bash
292+
run: |
293+
set -euxo pipefail
294+
mk_manifest() {
295+
local repo="$1"; local tag="$2"
296+
docker buildx imagetools create \
297+
-t ${repo}:${tag} \
298+
${repo}:${{ steps.tags.outputs.patch }}-amd64 \
299+
${repo}:${{ steps.tags.outputs.patch }}-arm64
300+
}
301+
# patch tag already exists per-arch; aggregate into MAJOR.MINOR.PATCH, MAJOR.MINOR, MAJOR, latest
302+
mk_manifest replicated/troubleshoot ${{ steps.tags.outputs.patch }}
303+
mk_manifest replicated/troubleshoot ${{ steps.tags.outputs.minor }}
304+
mk_manifest replicated/troubleshoot ${{ steps.tags.outputs.major }}
305+
mk_manifest replicated/troubleshoot latest
306+
307+
mk_manifest replicated/preflight ${{ steps.tags.outputs.patch }}
308+
mk_manifest replicated/preflight ${{ steps.tags.outputs.minor }}
309+
mk_manifest replicated/preflight ${{ steps.tags.outputs.major }}
310+
mk_manifest replicated/preflight latest
311311
312312
# ---------------------------
313313
# Homebrew tap PR (Formula)

0 commit comments

Comments
 (0)