Create and publish a Docker image for verifiable-sc. #10
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Create and publish a Docker image for verifiable-sc. | |
| on: | |
| workflow_dispatch: # allows manual trigger | |
| push: | |
| tags: | |
| - 'verifiable-sc/*.*.*' | |
| env: | |
| REGISTRY: docker.io | |
| SERVICE_NAME: 'verifiable-sc' | |
| RUST_VERSION: '1.85.0' | |
| jobs: | |
| build-and-push-image: | |
| runs-on: ubuntu-latest | |
| environment: testnet-deployments | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: ${{ env.RUST_VERSION }} | |
| target: wasm32-unknown-unknown | |
| - run: docker build -f ./reproducible/build.Dockerfile --build-arg source_image="rust:$RUST_VERSION" -t "concordium/$SERVICE_NAME:$RUST_VERSION" ./reproducible | |
| - name: Test smart contract | |
| working-directory: ./reproducible/example-contract | |
| run: | | |
| CARGO_CONCORDIUM="cargo run --manifest-path $GITHUB_WORKSPACE/cargo-concordium/Cargo.toml --target x86_64-unknown-linux-gnu -- concordium" | |
| $CARGO_CONCORDIUM build --verifiable "concordium/$SERVICE_NAME:$RUST_VERSION" | |
| $CARGO_CONCORDIUM verify-build --module ./concordium-out/module.wasm.v1 --source ./concordium-out/module.wasm.v1.tar | |
| - name: Extract version from git tag | |
| env: | |
| TAG: ${{ github.ref_name }} | |
| run: | | |
| # Extract version by splitting on "/" and taking the second part | |
| TAG_VERSION=$(echo "$TAG" | cut -d '/' -f2) | |
| if [ "$TAG_VERSION" != "$RUST_VERSION" ]; then | |
| echo "Tag version does not match the declared rust version." | |
| exit 1 | |
| fi | |
| # - name: Log in to the Container registry | |
| # uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | |
| # with: | |
| # registry: ${{ env.REGISTRY }} | |
| # username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| # password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| # - name: Push the image | |
| # run: docker push "concordium/$SERVICE_NAME:$RUST_VERSION" |