From 276061d534d80c19a3cd6b9f548ae214ea272e3c Mon Sep 17 00:00:00 2001 From: Tarrence van As Date: Tue, 16 Apr 2024 10:22:57 -0400 Subject: [PATCH] Update devcontainer on release --- .devcontainer/Dockerfile | 3 ++- .github/workflows/devcontainer.yml | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 6ab5bec682..20c25f2ce4 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -60,10 +60,11 @@ RUN if [ "$TARGETPLATFORM" = "linux/arm64" ] ; then \ rustup target add x86_64-fortanix-unknown-sgx --toolchain nightly; \ fi +ARG DOJO_VERSION=stable RUN curl -L https://install.dojoengine.org | bash RUN curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | bash ENV PATH=${PATH}:/root/.dojo/bin -RUN dojoup +RUN dojoup -v $DOJO_VERSION RUN chown -R root:root /usr/local/cargo RUN chmod -R 700 /usr/local/cargo diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml index 8ab6643801..5a2661dc2e 100644 --- a/.github/workflows/devcontainer.yml +++ b/.github/workflows/devcontainer.yml @@ -6,6 +6,8 @@ on: - ".devcontainer/**" - ".github/workflows/devcontainer.yml" - "!.devcontainer/devcontainer.json" + release: + types: [published] jobs: build-and-push: @@ -56,6 +58,7 @@ jobs: tags: ghcr.io/${{ github.repository }}-dev:latest,ghcr.io/${{ github.repository }}-dev:${{ env.DOCKER_TAG }} build-args: | VARIANT=bookworm + DOJO_VERSION=${{ github.event_name == 'release' && github.event.release.tag_name || 'stable' }} platforms: linux/amd64,linux/arm64 cache-from: type=registry,ref=ghcr.io/${{ github.repository }}-dev:latest @@ -85,8 +88,8 @@ jobs: with: # We have to use a PAT in order to trigger ci token: ${{ secrets.CREATE_PR_TOKEN }} - title: "Update devcontainer image hash: ${{ needs.build-and-push.outputs.tag_name }}" - commit-message: "Update devcontainer image hash: ${{ needs.build-and-push.outputs.tag_name }}" + title: "Update devcontainer image: ${{ needs.build-and-push.outputs.tag_name }}" + commit-message: "Update devcontainer image: ${{ needs.build-and-push.outputs.tag_name }}" branch: bump-devcontainer base: main delete-branch: true