1010env :
1111 REGISTRY : docker.io
1212 SERVICE_NAME : ' verifiable-sc'
13- SOURCE_IMAGE_TAG : ' rust: 1.85.0'
13+ RUST_VERSION : ' 1.85.0'
1414
1515jobs :
1616 build-and-push-image :
@@ -21,50 +21,32 @@ jobs:
2121 uses : actions/checkout@v4
2222 with :
2323 submodules : recursive
24- - run : |
25- rustup update stable
26- rustup default stable
27- rustup target add wasm32-unknown-unknown
28- # - uses: cachix/install-nix-action@v31
24+ - uses : actions-rust-lang/setup-rust-toolchain@v1
25+ with :
26+ toolchain : ${{ env.RUST_VERSION }}
27+ target : wasm32-unknown-unknown
28+ - run : docker build -f ./reproducible/build.Dockerfile --build-arg source_image="rust:$RUST_VERSION" -t "concordium/$SERVICE_NAME:$RUST_VERSION" ./reproducible
2929 - name : Test smart contract
30- env :
31- TAG : ${{ github.ref_name }}
32- working-directory : ./concordium-base/smart-contracts/rust-contracts/example-contracts/fib
30+ working-directory : ./reproducible/example-contract
3331 run : |
34- docker build -f "$GITHUB_WORKSPACE/reproducible/build.Dockerfile" --build-arg source_image="$SOURCE_IMAGE_TAG" -t local-image "$GITHUB_WORKSPACE/reproducible"
35- cargo run --manifest-path "$GITHUB_WORKSPACE/cargo-concordium/Cargo.toml"
36- # cargo run --manifest-path "$GITHUB_WORKSPACE/cargo-concordium/Cargo.toml" -- concordium build --verifiable "localhost/local-image:latest"
37- # cargo run --manifest-path "$GITHUB_WORKSPACE/cargo-concordium/Cargo.toml" -- concordium verify-build --module ./concordium-out/module.wasm.v1 --source ./concordium-out/module.wasm.v1.tar
32+ CARGO_CONCORDIUM="cargo run --manifest-path $GITHUB_WORKSPACE/cargo-concordium/Cargo.toml --target x86_64-unknown-linux-gnu -- concordium"
33+ $CARGO_CONCORDIUM build --verifiable "concordium/$SERVICE_NAME:$RUST_VERSION"
34+ $CARGO_CONCORDIUM verify-build --module ./concordium-out/module.wasm.v1 --source ./concordium-out/module.wasm.v1.tar
3835 - name : Extract version from git tag
39- id : meta
4036 env :
4137 TAG : ${{ github.ref_name }}
4238 run : |
4339 # Extract version by splitting on "/" and taking the second part
4440 TAG_VERSION=$(echo "$TAG" | cut -d '/' -f2)
45- IMG_VERSION=$(echo "$SOURCE_IMAGE_TAG" | cut -d ':' -f2)
46-
47- if [ $TAG_VERSION != $IMG_VERSION ]; then
48- echo "Tag version does not match the source image version."
41+ if [ "$TAG_VERSION" != "$RUST_VERSION" ]; then
42+ echo "Tag version does not match the declared rust version."
4943 exit 1
5044 fi
51-
52- # Save tag as fx "docker.io/concordium/verifiable-sc-1.85.0"
53- echo "tag=$REGISTRY/concordium/$SERVICE_NAME-$TAG_VERSION" >> $GITHUB_OUTPUT
54- # Uses the `docker/login-action` action to log in to the Container registry.
5545 # - name: Log in to the Container registry
5646 # uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
5747 # with:
5848 # registry: ${{ env.REGISTRY }}
5949 # username: ${{ secrets.DOCKERHUB_USERNAME }}
6050 # password: ${{ secrets.DOCKERHUB_TOKEN }}
61- # - name: Build and push Docker image
62- # uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
63- # with:
64- # context: .
65- # file: ./reproducible/build.Dockerfile
66- # push: true
67- # platforms: linux/amd64
68- # tags: ${{ steps.meta.outputs.tag }}
69- # build-args: |
70- # source_image=${{ env.SOURCE_IMAGE_TAG }}
51+ # - name: Push the image
52+ # run: docker push "concordium/$SERVICE_NAME:$RUST_VERSION"
0 commit comments