diff --git a/.github/workflows/publish-release-artifacts.yml b/.github/workflows/publish-release-artifacts.yml index 1f6e96b68a..d36580150b 100644 --- a/.github/workflows/publish-release-artifacts.yml +++ b/.github/workflows/publish-release-artifacts.yml @@ -43,6 +43,7 @@ jobs: echo "::set-output name=version::$VERSION" echo "::set-output name=taggedVersion::$TAGGED_VERSION" echo "::set-output name=updateNumber::$UPDATE_NUMBER" + echo "::set-output name=longVersion::$LONG_VERSION" - name: Download artifacts run: | @@ -117,40 +118,45 @@ jobs: username: ${{ secrets.DOCKER_HUB_USER }} password: ${{ secrets.DOCKER_HUB_TOKEN }} - - name: Process docker + - name: Clone Docker Repo id: process-docker run: | git clone --single-branch --branch master https://github.com/ballerina-platform/module-ballerina-docker DOCKER_REPO='module-ballerina-docker' echo "::set-output name=dockerRepo::$DOCKER_REPO" - - name: Enable experimental functions - run: | - echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json - sudo service docker restart - docker version - - - name: Build and push docker image + - name: Copy artifacts to Docker repo run: | DOCKER_REPO=${{ steps.process-docker.outputs.dockerRepo }} cp $VERSION/ballerina-$VERSION.zip $DOCKER_REPO/base/docker/ + cp $VERSION/ballerina-$LONG_VERSION-linux-x64.deb $DOCKER_REPO/base/devcontainer/ - docker build --no-cache=true --squash --build-arg BALLERINA_DIST=ballerina-$VERSION.zip -t ballerina/ballerina:$GIT_TAG $DOCKER_REPO/base/docker/ - rm $DOCKER_REPO/base/docker/ballerina-$VERSION.zip - docker push ballerina/ballerina:$GIT_TAG - docker rmi ballerina/ballerina:$GIT_TAG - docker image prune -f + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - - name: Build and push dev container - run: | - DOCKER_REPO=${{ steps.process-docker.outputs.dockerRepo }} - cp $VERSION/ballerina-$LONG_VERSION-linux-x64.deb $DOCKER_REPO/base/devcontainer/ + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - docker build --no-cache=true --squash --build-arg BALLERINA_DIST=ballerina-$LONG_VERSION-linux-x64.deb -t ballerina/ballerina-devcontainer:$GIT_TAG $DOCKER_REPO/base/devcontainer - rm $DOCKER_REPO/base/devcontainer/ballerina-$LONG_VERSION-linux-x64.deb - docker push ballerina/ballerina-devcontainer:$GIT_TAG - docker rmi ballerina/ballerina-devcontainer:$GIT_TAG - docker image prune -f + - name: Build and push the Ballerina Docker image + id: docker_build + uses: docker/build-push-action@v6 + with: + context: ${{ steps.process-docker.outputs.dockerRepo }}/base/docker/ + push: true + tags: ballerina/ballerina:${{ steps.set-version.outputs.taggedVersion }} + platforms: linux/amd64,linux/arm64 + build-args: | + BALLERINA_DIST=ballerina-${{ steps.set-version.outputs.version }}.zip + + - name: Build and push dev container image + id: docker_build_devcontainer + uses: docker/build-push-action@v6 + with: + context: ${{ steps.process-docker.outputs.dockerRepo }}/base/devcontainer/ + push: true + tags: ballerina/ballerina-devcontainer:${{ steps.set-version.outputs.taggedVersion }} + build-args: | + BALLERINA_DIST=ballerina-${{ steps.set-version.outputs.longVersion }}-linux-x64.deb - name: Publish Artifacts run: | diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 66977cb498..da163d2fd6 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -102,7 +102,6 @@ jobs: context: module-ballerina-docker/base/docker/ load: true push: false - platforms: linux/amd64,linux/arm64 tags: ballerina/ballerina:release-test build-args: | BALLERINA_DIST=ballerina-${{ steps.version-set.outputs.sversion }}.zip