diff --git a/.github/workflows/release-auction-sponsored-txs-docker.yml b/.github/workflows/release-auction-sponsored-txs-docker.yml new file mode 100644 index 00000000..206ee201 --- /dev/null +++ b/.github/workflows/release-auction-sponsored-txs-docker.yml @@ -0,0 +1,60 @@ +# This job builds and publishes a docker image for the sponsored transactions auction dApp to +# the dockerhub image repository. +name: Create and publish a Docker image for the sponsored transactions auction dApp. + +on: + workflow_dispatch: # allows manual trigger + + push: + tags: + # The versioning is of the format: `frontend_version-backend_version`. + - 'cis2-auction-sponsored-txs/*.*.*-*.*.*' + +env: + REGISTRY: docker.io + IMAGE_NAME: dapp-auction-sponsored-txs + EXPECTED_TAG: ${{ github.ref_name }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + environment: testnet-deployments + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + # Uses the `docker/login-action` action to log in to the Container registry. + - 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: Extract tag from package.json and Cargo.toml files + id: meta + run: | + export FRONTEND_VERSION=$(jq -r .version sponsoredTransactionsAuction/frontend/package.json) + export BACKEND_VERSION=$(yq .package.version sponsoredTransactionsAuction/backend/Cargo.toml) + export VERSION=${FRONTEND_VERSION}-${BACKEND_VERSION} + export FULL_IMAGE_TAG="${{ env.REGISTRY }}/concordium/$IMAGE_NAME:$VERSION" + echo "::notice FULL_IMAGE_TAG=${FULL_IMAGE_TAG}" + # Make sure the image does not exist. Abort if we can retrieve any metadata. + if docker manifest inspect ${FULL_IMAGE_TAG} > /dev/null; then + echo "::error ${FULL_IMAGE_TAG} already exists" + exit 1 + elif [ ! "${EXPECTED_TAG}" = "cis2-auction-sponsored-txs/${VERSION}" ]; then + echo "::error Expected tag ${EXPECTED_TAG} does not match the version ${VERSION}." + exit 1 + else + # Store the full image tag into a tag variable for the following step. + echo "tag=${FULL_IMAGE_TAG}" > "$GITHUB_OUTPUT" + fi + - name: Build and push Docker image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + file: ./sponsoredTransactionsAuction/Dockerfile + push: true + platforms: linux/amd64 + tags: ${{ steps.meta.outputs.tag }} diff --git a/.github/workflows/release-euro-demo.yml b/.github/workflows/release-euro-demo.yml index 1e39dbb7..e5467f75 100644 --- a/.github/workflows/release-euro-demo.yml +++ b/.github/workflows/release-euro-demo.yml @@ -36,6 +36,9 @@ jobs: if docker manifest inspect ${FULL_IMAGE_TAG} > /dev/null; then echo "::error ${FULL_IMAGE_TAG} already exists" exit 1 + elif [ ! "${{ github.ref_name }}" = "release/euroe-demo/${VERSION}" ]; then + echo "::error Expected tag ${EXPECTED_TAG} does not match the version ${VERSION}." + exit 1 else # Store the full image tag into a tag variable for the following step. echo "tag=${FULL_IMAGE_TAG}" > "$GITHUB_OUTPUT" diff --git a/.github/workflows/release-gallery-docker.yml b/.github/workflows/release-gallery-docker.yml new file mode 100644 index 00000000..311bc56e --- /dev/null +++ b/.github/workflows/release-gallery-docker.yml @@ -0,0 +1,56 @@ +# This job builds and publishes a docker image for the gallery dApp to +# the dockerhub image repository. +name: Create and publish a Docker image for the gallery dApp. + +on: + workflow_dispatch: # allows manual trigger + + push: + tags: + - 'gallery/*.*.*' + +env: + REGISTRY: docker.io + IMAGE_NAME: dapp-gallery + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + environment: testnet-deployments + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + # Uses the `docker/login-action` action to log in to the Container registry. + - 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: Extract tag from package.json + id: meta + run: | + export VERSION=$(jq -r .version gallery/package.json) + export FULL_IMAGE_TAG="${{ env.REGISTRY }}/concordium/$IMAGE_NAME:$VERSION" + echo "::notice FULL_IMAGE_TAG=${FULL_IMAGE_TAG}" + # Make sure the image does not exist. Abort if we can retrieve any metadata. + if docker manifest inspect ${FULL_IMAGE_TAG} > /dev/null; then + echo "::error ${FULL_IMAGE_TAG} already exists" + exit 1 + elif [ ! "${{ github.ref_name }}" = "gallery/${VERSION}" ]; then + echo "::error Expected tag ${EXPECTED_TAG} does not match the version ${VERSION}." + exit 1 + else + # Store the full image tag into a tag variable for the following step. + echo "tag=${FULL_IMAGE_TAG}" > "$GITHUB_OUTPUT" + fi + - name: Build and push Docker image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + file: gallery/Dockerfile + push: true + platforms: linux/amd64 + tags: ${{ steps.meta.outputs.tag }} diff --git a/.github/workflows/release-sign-message-docker.yml b/.github/workflows/release-sign-message-docker.yml new file mode 100644 index 00000000..d622c965 --- /dev/null +++ b/.github/workflows/release-sign-message-docker.yml @@ -0,0 +1,56 @@ +# This job builds and publishes a docker image for the sign message dApp to +# the dockerhub image repository. +name: Create and publish a Docker image for the sign message dApp. + +on: + workflow_dispatch: # allows manual trigger + + push: + tags: + - 'signmessage/*.*.*' + +env: + REGISTRY: docker.io + IMAGE_NAME: dapp-signmessage + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + environment: testnet-deployments + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + # Uses the `docker/login-action` action to log in to the Container registry. + - 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: Extract tag from package.json + id: meta + run: | + export VERSION=$(jq -r .version signMessage/package.json) + export FULL_IMAGE_TAG="${{ env.REGISTRY }}/concordium/$IMAGE_NAME:$VERSION" + echo "::notice FULL_IMAGE_TAG=${FULL_IMAGE_TAG}" + # Make sure the image does not exist. Abort if we can retrieve any metadata. + if docker manifest inspect ${FULL_IMAGE_TAG} > /dev/null; then + echo "::error ${FULL_IMAGE_TAG} already exists" + exit 1 + elif [ ! "${{ github.ref_name }}" = "signmessage/${VERSION}" ]; then + echo "::error Expected tag ${EXPECTED_TAG} does not match the version ${VERSION}." + exit 1 + else + # Store the full image tag into a tag variable for the following step. + echo "tag=${FULL_IMAGE_TAG}" > "$GITHUB_OUTPUT" + fi + - name: Build and push Docker image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: ./signMessage + file: ./signMessage/Dockerfile + push: true + platforms: linux/amd64 + tags: ${{ steps.meta.outputs.tag }} diff --git a/.github/workflows/release-simple-age-verification-docker.yml b/.github/workflows/release-simple-age-verification-docker.yml new file mode 100644 index 00000000..2cea171a --- /dev/null +++ b/.github/workflows/release-simple-age-verification-docker.yml @@ -0,0 +1,56 @@ +# This job builds and publishes a docker image for the simple age verification dApp to +# the dockerhub image repository. +name: Create and publish a Docker image for the simple age verification dApp. + +on: + workflow_dispatch: # allows manual trigger + + push: + tags: + - 'simple-age-verification/*.*.*' + +env: + REGISTRY: docker.io + IMAGE_NAME: dapp-simple-age-verification + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + environment: testnet-deployments + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + # Uses the `docker/login-action` action to log in to the Container registry. + - 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: Extract tag from package.json + id: meta + run: | + export VERSION=$(jq -r .version simpleAgeVerification/package.json) + export FULL_IMAGE_TAG="${{ env.REGISTRY }}/concordium/$IMAGE_NAME:$VERSION" + echo "::notice FULL_IMAGE_TAG=${FULL_IMAGE_TAG}" + # Make sure the image does not exist. Abort if we can retrieve any metadata. + if docker manifest inspect ${FULL_IMAGE_TAG} > /dev/null; then + echo "::error ${FULL_IMAGE_TAG} already exists" + exit 1 + elif [ ! "${{ github.ref_name }}" = "simple-age-verification/${VERSION}" ]; then + echo "::error Expected tag ${EXPECTED_TAG} does not match the version ${VERSION}." + exit 1 + else + # Store the full image tag into a tag variable for the following step. + echo "tag=${FULL_IMAGE_TAG}" > "$GITHUB_OUTPUT" + fi + - name: Build and push Docker image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: ./simpleAgeVerification + file: ./simpleAgeVerification/Dockerfile + push: true + platforms: linux/amd64 + tags: ${{ steps.meta.outputs.tag }} diff --git a/.github/workflows/release-sponsored-txs-docker.yml b/.github/workflows/release-sponsored-txs-docker.yml new file mode 100644 index 00000000..ee4d9d88 --- /dev/null +++ b/.github/workflows/release-sponsored-txs-docker.yml @@ -0,0 +1,59 @@ +# This job builds and publishes a docker image for the sponsored transactions dApp to +# the dockerhub image repository. +name: Create and publish a Docker image for the sponsored transactions dApp. + +on: + workflow_dispatch: # allows manual trigger + + push: + tags: + # The versioning is of the format: `frontend_version-backend_version`. + - 'sponsored-transactions/*.*.*-*.*.*' + +env: + REGISTRY: docker.io + IMAGE_NAME: dapp-sponsored-txs + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + environment: testnet-deployments + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + # Uses the `docker/login-action` action to log in to the Container registry. + - 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: Extract tag from package.json and Cargo.toml files + id: meta + run: | + export FRONTEND_VERSION=$(jq -r .version sponsoredTransactions/frontend/package.json) + export BACKEND_VERSION=$(yq .package.version sponsoredTransactions/backend/Cargo.toml) + export VERSION=$FRONTEND_VERSION-$BACKEND_VERSION + export FULL_IMAGE_TAG="${{ env.REGISTRY }}/concordium/$IMAGE_NAME:$VERSION" + echo "::notice FULL_IMAGE_TAG=${FULL_IMAGE_TAG}" + # Make sure the image does not exist. Abort if we can retrieve any metadata. + if docker manifest inspect ${FULL_IMAGE_TAG} > /dev/null; then + echo "::error ${FULL_IMAGE_TAG} already exists" + exit 1 + elif [ ! "${{ github.ref_name }}" = "sponsored-transactions/${VERSION}" ]; then + echo "::error Expected tag ${EXPECTED_TAG} does not match the version ${VERSION}." + exit 1 + else + # Store the full image tag into a tag variable for the following step. + echo "tag=${FULL_IMAGE_TAG}" > "$GITHUB_OUTPUT" + fi + - name: Build and push Docker image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + file: ./sponsoredTransactions/Dockerfile + push: true + platforms: linux/amd64 + tags: ${{ steps.meta.outputs.tag }} diff --git a/gallery/Jenkinsfile b/gallery/Jenkinsfile deleted file mode 100644 index 3d06b726..00000000 --- a/gallery/Jenkinsfile +++ /dev/null @@ -1,36 +0,0 @@ -// Expected parameters: -// - image_tag: Tag that will be used for the new image. -// - build_image: Base image that the image being built extends. -pipeline { - agent any - environment { - image_repo = "concordium/dapp-gallery" - image_name = "${image_repo}:${image_tag}" - } - stages { - stage('dockerhub-login') { - environment { - // Defines 'CRED_USR' and 'CRED_PSW' - // (see 'https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#handling-credentials'). - CRED = credentials('jenkins-dockerhub') - } - steps { - sh 'docker login --username "${CRED_USR}" --password "${CRED_PSW}"' - } - } - stage('build-push') { - steps { - sh '''\ - docker build \ - --build-arg build_image="${build_image}" \ - --label build_image="${build_image}" \ - --tag="${image_name}" \ - -f ./gallery/Dockerfile \ - . - docker push "${image_name}" - '''.stripIndent() - } - } - } -} - diff --git a/gallery/package.json b/gallery/package.json index 5c2bb350..9f82650a 100644 --- a/gallery/package.json +++ b/gallery/package.json @@ -1,7 +1,7 @@ { "name": "gallery", "license": "Apache-2.0", - "version": "0.1.2", + "version": "0.1.3", "packageManager": "yarn@1.22.0", "dependencies": { "@concordium/browser-wallet-api-helpers": "^3.0.1", diff --git a/signMessage/Jenkinsfile b/signMessage/Jenkinsfile deleted file mode 100644 index 63877014..00000000 --- a/signMessage/Jenkinsfile +++ /dev/null @@ -1,35 +0,0 @@ -// Expected parameters: -// - image_tag: Tag that will be used for the new image. -// - build_image: Base image that the image being built extends. -pipeline { - agent any - environment { - image_repo = "concordium/dapp-signmessage" - image_name = "${image_repo}:${image_tag}" - } - stages { - stage('dockerhub-login') { - environment { - // Defines 'CRED_USR' and 'CRED_PSW' - // (see 'https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#handling-credentials'). - CRED = credentials('jenkins-dockerhub') - } - steps { - sh 'docker login --username "${CRED_USR}" --password "${CRED_PSW}"' - } - } - stage('build-push') { - steps { - sh '''\ - docker build \ - --build-arg build_image="${build_image}" \ - --label build_image="${build_image}" \ - --tag="${image_name}" \ - --pull \ - ./signMessage - docker push "${image_name}" - '''.stripIndent() - } - } - } -} diff --git a/signMessage/package.json b/signMessage/package.json index 69e65911..7df2fc27 100644 --- a/signMessage/package.json +++ b/signMessage/package.json @@ -1,6 +1,6 @@ { "name": "sign_message", - "version": "0.2.1", + "version": "0.2.2", "private": true, "dependencies": { "@concordium/browser-wallet-api-helpers": "^0.2.0", diff --git a/simpleAgeVerification/Jenkinsfile b/simpleAgeVerification/Jenkinsfile deleted file mode 100644 index 48dde2eb..00000000 --- a/simpleAgeVerification/Jenkinsfile +++ /dev/null @@ -1,35 +0,0 @@ -// Expected parameters: -// - image_tag: Tag that will be used for the new image. -// - build_image: Base image that the image being built extends. -pipeline { - agent any - environment { - image_repo = "concordium/dapp-simple-age-verification" - image_name = "${image_repo}:${image_tag}" - } - stages { - stage('dockerhub-login') { - environment { - // Defines 'CRED_USR' and 'CRED_PSW' - // (see 'https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#handling-credentials'). - CRED = credentials('jenkins-dockerhub') - } - steps { - sh 'docker login --username "${CRED_USR}" --password "${CRED_PSW}"' - } - } - stage('build-push') { - steps { - sh '''\ - docker build \ - --build-arg build_image="${build_image}" \ - --label build_image="${build_image}" \ - --tag="${image_name}" \ - -f ./simpleAgeVerification/Dockerfile \ - ./simpleAgeVerification - docker push "${image_name}" - '''.stripIndent() - } - } - } -} diff --git a/sponsoredTransactions/frontend/Jenkinsfile b/sponsoredTransactions/frontend/Jenkinsfile deleted file mode 100644 index 852f8154..00000000 --- a/sponsoredTransactions/frontend/Jenkinsfile +++ /dev/null @@ -1,36 +0,0 @@ -// Expected parameters: -// - image_tag: Tag that will be used for the new image. -// - build_image: Base image that the image being built extends. -pipeline { - agent any - environment { - image_repo = "concordium/dapp-sponsored-txs" - image_name = "${image_repo}:${image_tag}" - } - stages { - stage('dockerhub-login') { - environment { - // Defines 'CRED_USR' and 'CRED_PSW' - // (see 'https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#handling-credentials'). - CRED = credentials('jenkins-dockerhub') - } - steps { - sh 'docker login --username "${CRED_USR}" --password "${CRED_PSW}"' - } - } - stage('build-push') { - steps { - sh '''\ - docker build \ - --build-arg build_image="${build_image}" \ - --label build_image="${build_image}" \ - --tag="${image_name}" \ - --pull \ - --file sponsoredTransactions/Dockerfile \ - . - docker push "${image_name}" - '''.stripIndent() - } - } - } -} diff --git a/sponsoredTransactionsAuction/frontend/Jenkinsfile b/sponsoredTransactionsAuction/frontend/Jenkinsfile deleted file mode 100644 index 6d9b622d..00000000 --- a/sponsoredTransactionsAuction/frontend/Jenkinsfile +++ /dev/null @@ -1,36 +0,0 @@ -// Expected parameters: -// - image_tag: Tag that will be used for the new image. -// - build_image: Base image that the image being built extends. -pipeline { - agent any - environment { - image_repo = "concordium/dapp-auction-sponsored-txs" - image_name = "${image_repo}:${image_tag}" - } - stages { - stage('dockerhub-login') { - environment { - // Defines 'CRED_USR' and 'CRED_PSW' - // (see 'https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#handling-credentials'). - CRED = credentials('jenkins-dockerhub') - } - steps { - sh 'docker login --username "${CRED_USR}" --password "${CRED_PSW}"' - } - } - stage('build-push') { - steps { - sh '''\ - docker build \ - --build-arg build_image="${build_image}" \ - --label build_image="${build_image}" \ - --tag="${image_name}" \ - --pull \ - --file sponsoredTransactionsAuction/Dockerfile \ - . - docker push "${image_name}" - '''.stripIndent() - } - } - } -}