Skip to content

Commit

Permalink
Publish arm docker images as part of the release process
Browse files Browse the repository at this point in the history
  • Loading branch information
noituri committed Dec 12, 2024
1 parent 97405df commit a3c0545
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 12 deletions.
48 changes: 42 additions & 6 deletions .github/workflows/package_for_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jobs:
name: smelter_with_web_renderer_darwin_aarch64.tar.gz
path: smelter_with_web_renderer_darwin_aarch64.tar.gz

docker:
docker-amd64:
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout repo
Expand All @@ -140,12 +140,12 @@ jobs:
- name: 🔨 Build Smelter image
run: |
docker buildx build --platform linux/amd64 -t ghcr.io/software-mansion/smelter:${{ github.sha }} -f build_tools/docker/slim.Dockerfile .
docker buildx build --platform linux/amd64 -t ghcr.io/software-mansion/smelter:${{ github.sha }}-amd64 -f build_tools/docker/slim.Dockerfile .
- name: 📤 Upload image
run: docker push ghcr.io/software-mansion/smelter:${{ github.sha }}
run: docker push ghcr.io/software-mansion/smelter:${{ github.sha }}-amd64

docker-with-web-renderer:
docker-with-web-renderer-amd64:
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout repo
Expand All @@ -157,7 +157,43 @@ jobs:
- name: 🔨 Build Smelter with Web Renderer image
run: |
docker buildx build --platform linux/amd64 -t ghcr.io/software-mansion/smelter:${{ github.sha }}-web-renderer -f build_tools/docker/full.Dockerfile .
docker buildx build --platform linux/amd64 -t ghcr.io/software-mansion/smelter:${{ github.sha }}-web-renderer-amd64 -f build_tools/docker/full.Dockerfile .
- name: 📤 Upload image
run: docker push ghcr.io/software-mansion/smelter:${{ github.sha }}-web-renderer
run: docker push ghcr.io/software-mansion/smelter:${{ github.sha }}-web-renderer-amd64

docker-arm64:
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout repo
uses: actions/checkout@v4

- name: 🛠️ Setup Docker
run: |
docker run --privileged --rm tonistiigi/binfmt --install all
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: 🔨 Build Smelter image
run: |
docker buildx build --platform linux/arm64 -t ghcr.io/software-mansion/smelter:${{ github.sha }}-arm64 -f build_tools/docker/slim.Dockerfile .
- name: 📤 Upload image
run: docker push ghcr.io/software-mansion/smelter:${{ github.sha }}-arm64

docker-with-web-renderer-arm64:
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout repo
uses: actions/checkout@v4

- name: 🛠️ Setup Docker
run: |
docker run --privileged --rm tonistiigi/binfmt --install all
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: 🔨 Build Smelter with Web Renderer image
run: |
docker buildx build --platform linux/arm64 -t ghcr.io/software-mansion/smelter:${{ github.sha }}-web-renderer-arm64 -f build_tools/docker/full.Dockerfile .
- name: 📤 Upload image
run: docker push ghcr.io/software-mansion/smelter:${{ github.sha }}-web-renderer-arm64
31 changes: 25 additions & 6 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,33 @@ gh run download "$WORKFLOW_RUN_ID" -n smelter_with_web_renderer_darwin_x86_64.ta
gh run download "$WORKFLOW_RUN_ID" -n smelter_with_web_renderer_darwin_aarch64.tar.gz

IMAGE_NAME="ghcr.io/software-mansion/smelter"
docker pull "${IMAGE_NAME}:${COMMIT_HASH}"
docker pull "${IMAGE_NAME}:${COMMIT_HASH}-web-renderer"
docker pull "${IMAGE_NAME}:${COMMIT_HASH}-amd64"
docker pull "${IMAGE_NAME}:${COMMIT_HASH}-arm64"
docker pull "${IMAGE_NAME}:${COMMIT_HASH}-web-renderer-amd64"
docker pull "${IMAGE_NAME}:${COMMIT_HASH}-web-renderer-arm64"

docker tag "${IMAGE_NAME}:${COMMIT_HASH}" "${IMAGE_NAME}:${RELEASE_TAG}"
docker tag "${IMAGE_NAME}:${COMMIT_HASH}-web-renderer" "${IMAGE_NAME}:${RELEASE_TAG}-web-renderer"
docker tag "${IMAGE_NAME}:${COMMIT_HASH}-amd64" "${IMAGE_NAME}:${RELEASE_TAG}-amd64"
docker tag "${IMAGE_NAME}:${COMMIT_HASH}-arm64" "${IMAGE_NAME}:${RELEASE_TAG}-arm64"
docker tag "${IMAGE_NAME}:${COMMIT_HASH}-web-renderer-amd64" "${IMAGE_NAME}:${RELEASE_TAG}-web-renderer-amd64"
docker tag "${IMAGE_NAME}:${COMMIT_HASH}-web-renderer-arm64" "${IMAGE_NAME}:${RELEASE_TAG}-web-renderer-arm64"

docker push "${IMAGE_NAME}:${RELEASE_TAG}"
docker push "${IMAGE_NAME}:${RELEASE_TAG}-web-renderer"
docker push "${IMAGE_NAME}:${RELEASE_TAG}-amd64"
docker push "${IMAGE_NAME}:${RELEASE_TAG}-arm64"
docker push "${IMAGE_NAME}:${RELEASE_TAG}-web-renderer-amd64"
docker push "${IMAGE_NAME}:${RELEASE_TAG}-web-renderer-arm64"

docker manifest create "${IMAGE_NAME}:${RELEASE_TAG}" "${IMAGE_NAME}:${RELEASE_TAG}-amd64" "${IMAGE_NAME}:${RELEASE_TAG}-arm64"
docker manifest annotate "${IMAGE_NAME}:${RELEASE_TAG}" "${IMAGE_NAME}:${RELEASE_TAG}-amd64" --arch amd64
docker manifest annotate "${IMAGE_NAME}:${RELEASE_TAG}" "${IMAGE_NAME}:${RELEASE_TAG}-arm64" --arch arm64

docker manifest create "${IMAGE_NAME}:${RELEASE_TAG}-web-renderer" \
"${IMAGE_NAME}:${RELEASE_TAG}-web-renderer-amd64" \
"${IMAGE_NAME}:${RELEASE_TAG}-web-renderer-arm64"
docker manifest annotate "${IMAGE_NAME}:${RELEASE_TAG}-web-renderer" "${IMAGE_NAME}:${RELEASE_TAG}-web-renderer-amd64" --arch amd64
docker manifest annotate "${IMAGE_NAME}:${RELEASE_TAG}-web-renderer" "${IMAGE_NAME}:${RELEASE_TAG}-web-renderer-arm64" --arch arm64

docker manifest push "${IMAGE_NAME}:${RELEASE_TAG}"
docker manifest push "${IMAGE_NAME}:${RELEASE_TAG}-web-renderer"

gh release create "$RELEASE_TAG"
gh release upload "$RELEASE_TAG" smelter_linux_x86_64.tar.gz
Expand Down

0 comments on commit a3c0545

Please sign in to comment.