From 3b46ba16f7e9ef08c83c0f9cab7672f2fdde0650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lasse=20M=C3=B8ldrup?= Date: Tue, 26 Mar 2024 14:40:26 +0100 Subject: [PATCH 01/13] Add release actions for examples --- .../release-auction-sponsored-txs-docker.yml | 53 ++++++++++++++++++ .../workflows/release-euroe-demo-docker.yml | 53 ++++++++++++++++++ .github/workflows/release-gallery-docker.yml | 53 ++++++++++++++++++ .../workflows/release-sign-message-docker.yml | 56 +++++++++++++++++++ ...release-simple-age-verification-docker.yml | 53 ++++++++++++++++++ .../release-sponsored-txs-docker.yml | 53 ++++++++++++++++++ gallery/Jenkinsfile | 36 ------------ signMessage/Jenkinsfile | 35 ------------ simpleAgeVerification/Jenkinsfile | 35 ------------ sponsoredTransactions/frontend/Jenkinsfile | 36 ------------ .../frontend/Jenkinsfile | 36 ------------ 11 files changed, 321 insertions(+), 178 deletions(-) create mode 100644 .github/workflows/release-auction-sponsored-txs-docker.yml create mode 100644 .github/workflows/release-euroe-demo-docker.yml create mode 100644 .github/workflows/release-gallery-docker.yml create mode 100644 .github/workflows/release-sign-message-docker.yml create mode 100644 .github/workflows/release-simple-age-verification-docker.yml create mode 100644 .github/workflows/release-sponsored-txs-docker.yml delete mode 100644 gallery/Jenkinsfile delete mode 100644 signMessage/Jenkinsfile delete mode 100644 simpleAgeVerification/Jenkinsfile delete mode 100644 sponsoredTransactions/frontend/Jenkinsfile delete mode 100644 sponsoredTransactionsAuction/frontend/Jenkinsfile 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..18aefb95 --- /dev/null +++ b/.github/workflows/release-auction-sponsored-txs-docker.yml @@ -0,0 +1,53 @@ +# 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: + - 'cis2-sponsored-transactions/*.*.*' + +env: + REGISTRY: docker.io + IMAGE_NAME: concordium/dapp-auction-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 + id: meta + run: | + export VERSION=$(jq -r .version sponsoredTransactionAuction/frontend/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 + 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 }} \ No newline at end of file diff --git a/.github/workflows/release-euroe-demo-docker.yml b/.github/workflows/release-euroe-demo-docker.yml new file mode 100644 index 00000000..0a12db82 --- /dev/null +++ b/.github/workflows/release-euroe-demo-docker.yml @@ -0,0 +1,53 @@ +# This job builds and publishes a docker image for the euroe demo dApp to +# the dockerhub image repository. +name: Create and publish a Docker image for the euroe demo dApp. + +on: + workflow_dispatch: # allows manual trigger + + push: + tags: + - 'euroe-demo/*.*.*' + +env: + REGISTRY: docker.io + IMAGE_NAME: concordium/dapp-euroe-demo + +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 euroe-demo/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 + 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: ./euroe-demo + file: ./euroe-demo/scripts/Dockerfile + push: true + platforms: linux/amd64 + tags: ${{ steps.meta.outputs.tag }} \ No newline at end of file diff --git a/.github/workflows/release-gallery-docker.yml b/.github/workflows/release-gallery-docker.yml new file mode 100644 index 00000000..56eb6516 --- /dev/null +++ b/.github/workflows/release-gallery-docker.yml @@ -0,0 +1,53 @@ +# 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: concordium/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 + 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 }} \ No newline at end of file diff --git a/.github/workflows/release-sign-message-docker.yml b/.github/workflows/release-sign-message-docker.yml new file mode 100644 index 00000000..76aad3ba --- /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/*.*.*' + + pull_request: + branches: main + +env: + REGISTRY: docker.io + IMAGE_NAME: concordium/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 + 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 }} \ No newline at end of file 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..70cc6925 --- /dev/null +++ b/.github/workflows/release-simple-age-verification-docker.yml @@ -0,0 +1,53 @@ +# 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: concordium/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 + 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 }} \ No newline at end of file diff --git a/.github/workflows/release-sponsored-txs-docker.yml b/.github/workflows/release-sponsored-txs-docker.yml new file mode 100644 index 00000000..b3a3ccbf --- /dev/null +++ b/.github/workflows/release-sponsored-txs-docker.yml @@ -0,0 +1,53 @@ +# 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: + - 'sponsored-transactions/*.*.*' + +env: + REGISTRY: docker.io + IMAGE_NAME: concordium/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 + id: meta + run: | + export VERSION=$(jq -r .version sponsoredTransactions/frontend/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 + 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 }} \ No newline at end of file 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/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/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() - } - } - } -} From b6aca612b92575ad26cfde490f66e9f45fc477e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lasse=20M=C3=B8ldrup?= Date: Tue, 26 Mar 2024 15:14:00 +0100 Subject: [PATCH 02/13] Remove release signmessage on PR --- .github/workflows/release-sign-message-docker.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/release-sign-message-docker.yml b/.github/workflows/release-sign-message-docker.yml index 76aad3ba..997050f9 100644 --- a/.github/workflows/release-sign-message-docker.yml +++ b/.github/workflows/release-sign-message-docker.yml @@ -9,9 +9,6 @@ on: tags: - 'signmessage/*.*.*' - pull_request: - branches: main - env: REGISTRY: docker.io IMAGE_NAME: concordium/dapp-signmessage From 4a54b77e68002f0c38a23e7270a12b5ed97386d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lasse=20M=C3=B8ldrup?= Date: Tue, 26 Mar 2024 15:16:39 +0100 Subject: [PATCH 03/13] Remove concordium prefix from IMAGE_NAME --- .github/workflows/release-auction-sponsored-txs-docker.yml | 2 +- .github/workflows/release-euroe-demo-docker.yml | 2 +- .github/workflows/release-gallery-docker.yml | 2 +- .github/workflows/release-sign-message-docker.yml | 2 +- .github/workflows/release-simple-age-verification-docker.yml | 2 +- .github/workflows/release-sponsored-txs-docker.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-auction-sponsored-txs-docker.yml b/.github/workflows/release-auction-sponsored-txs-docker.yml index 18aefb95..8bfcf2e7 100644 --- a/.github/workflows/release-auction-sponsored-txs-docker.yml +++ b/.github/workflows/release-auction-sponsored-txs-docker.yml @@ -11,7 +11,7 @@ on: env: REGISTRY: docker.io - IMAGE_NAME: concordium/dapp-auction-sponsored-txs + IMAGE_NAME: dapp-auction-sponsored-txs jobs: build-and-push-image: diff --git a/.github/workflows/release-euroe-demo-docker.yml b/.github/workflows/release-euroe-demo-docker.yml index 0a12db82..0d43efc8 100644 --- a/.github/workflows/release-euroe-demo-docker.yml +++ b/.github/workflows/release-euroe-demo-docker.yml @@ -11,7 +11,7 @@ on: env: REGISTRY: docker.io - IMAGE_NAME: concordium/dapp-euroe-demo + IMAGE_NAME: dapp-euroe-demo jobs: build-and-push-image: diff --git a/.github/workflows/release-gallery-docker.yml b/.github/workflows/release-gallery-docker.yml index 56eb6516..79ca4d65 100644 --- a/.github/workflows/release-gallery-docker.yml +++ b/.github/workflows/release-gallery-docker.yml @@ -11,7 +11,7 @@ on: env: REGISTRY: docker.io - IMAGE_NAME: concordium/dapp-gallery + IMAGE_NAME: dapp-gallery jobs: build-and-push-image: diff --git a/.github/workflows/release-sign-message-docker.yml b/.github/workflows/release-sign-message-docker.yml index 997050f9..8280d4d8 100644 --- a/.github/workflows/release-sign-message-docker.yml +++ b/.github/workflows/release-sign-message-docker.yml @@ -11,7 +11,7 @@ on: env: REGISTRY: docker.io - IMAGE_NAME: concordium/dapp-signmessage + IMAGE_NAME: dapp-signmessage jobs: build-and-push-image: diff --git a/.github/workflows/release-simple-age-verification-docker.yml b/.github/workflows/release-simple-age-verification-docker.yml index 70cc6925..4b1eff4a 100644 --- a/.github/workflows/release-simple-age-verification-docker.yml +++ b/.github/workflows/release-simple-age-verification-docker.yml @@ -11,7 +11,7 @@ on: env: REGISTRY: docker.io - IMAGE_NAME: concordium/dapp-simple-age-verification + IMAGE_NAME: dapp-simple-age-verification jobs: build-and-push-image: diff --git a/.github/workflows/release-sponsored-txs-docker.yml b/.github/workflows/release-sponsored-txs-docker.yml index b3a3ccbf..ac3274b9 100644 --- a/.github/workflows/release-sponsored-txs-docker.yml +++ b/.github/workflows/release-sponsored-txs-docker.yml @@ -11,7 +11,7 @@ on: env: REGISTRY: docker.io - IMAGE_NAME: concordium/dapp-sponsored-txs + IMAGE_NAME: dapp-sponsored-txs jobs: build-and-push-image: From 1ab091506f83ee855ff89b59ad9bd1749aa30b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lasse=20M=C3=B8ldrup?= Date: Fri, 5 Apr 2024 15:27:26 +0200 Subject: [PATCH 04/13] Add backend versions to sponsored transactions dApps --- .../workflows/release-auction-sponsored-txs-docker.yml | 8 +++++--- .github/workflows/release-sponsored-txs-docker.yml | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-auction-sponsored-txs-docker.yml b/.github/workflows/release-auction-sponsored-txs-docker.yml index 8bfcf2e7..fe0181ea 100644 --- a/.github/workflows/release-auction-sponsored-txs-docker.yml +++ b/.github/workflows/release-auction-sponsored-txs-docker.yml @@ -7,7 +7,8 @@ on: push: tags: - - 'cis2-sponsored-transactions/*.*.*' + # The versioning is of the format: `frontend_version-backend_version`. + - 'cis2-sponsored-transactions/*.*.*-*.*.*' env: REGISTRY: docker.io @@ -32,8 +33,9 @@ jobs: - name: Extract tag from package.json id: meta run: | - export VERSION=$(jq -r .version sponsoredTransactionAuction/frontend/package.json) - export FULL_IMAGE_TAG="${{ env.REGISTRY }}/concordium/$IMAGE_NAME:$VERSION" + export FRONTEND_VERSION=$(jq -r .version sponsoredTransactionsAuction/frontend/package.json) + export BACKEND_VERSION=$(yq .package.version sponsoredTransactionsAuction/backend/Cargo.toml) + export FULL_IMAGE_TAG="${{ env.REGISTRY }}/concordium/$IMAGE_NAME:$FRONTEND_VERSION-$BACKEND_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 diff --git a/.github/workflows/release-sponsored-txs-docker.yml b/.github/workflows/release-sponsored-txs-docker.yml index ac3274b9..d1ce94bb 100644 --- a/.github/workflows/release-sponsored-txs-docker.yml +++ b/.github/workflows/release-sponsored-txs-docker.yml @@ -7,7 +7,8 @@ on: push: tags: - - 'sponsored-transactions/*.*.*' + # The versioning is of the format: `frontend_version-backend_version`. + - 'sponsored-transactions/*.*.*-*.*.*' env: REGISTRY: docker.io @@ -32,8 +33,9 @@ jobs: - name: Extract tag from package.json id: meta run: | - export VERSION=$(jq -r .version sponsoredTransactions/frontend/package.json) - export FULL_IMAGE_TAG="${{ env.REGISTRY }}/concordium/$IMAGE_NAME:$VERSION" + export FRONTEND_VERSION=$(jq -r .version sponsoredTransactions/frontend/package.json) + export BACKEND_VERSION=$(yq .package.version sponsoredTransactions/backend/Cargo.toml) + export FULL_IMAGE_TAG="${{ env.REGISTRY }}/concordium/$IMAGE_NAME:$FRONTEND_VERSION-$BACKEND_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 From 33653599944dd19089b4fa46e2c353e92a05bc7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Bizjak?= Date: Wed, 10 Apr 2024 08:21:55 +0200 Subject: [PATCH 05/13] Update .github/workflows/release-auction-sponsored-txs-docker.yml Co-authored-by: Doris Benda --- .github/workflows/release-auction-sponsored-txs-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-auction-sponsored-txs-docker.yml b/.github/workflows/release-auction-sponsored-txs-docker.yml index fe0181ea..056f7f5a 100644 --- a/.github/workflows/release-auction-sponsored-txs-docker.yml +++ b/.github/workflows/release-auction-sponsored-txs-docker.yml @@ -30,7 +30,7 @@ jobs: registry: ${{ env.REGISTRY }} username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Extract tag from package.json + - name: Extract tag from package.json and Cargo.toml files id: meta run: | export FRONTEND_VERSION=$(jq -r .version sponsoredTransactionsAuction/frontend/package.json) From 9c07219abb59049d13b791409bef855f629675ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Bizjak?= Date: Wed, 10 Apr 2024 08:22:09 +0200 Subject: [PATCH 06/13] Update .github/workflows/release-sponsored-txs-docker.yml Co-authored-by: Doris Benda --- .github/workflows/release-sponsored-txs-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-sponsored-txs-docker.yml b/.github/workflows/release-sponsored-txs-docker.yml index d1ce94bb..cab5cc4a 100644 --- a/.github/workflows/release-sponsored-txs-docker.yml +++ b/.github/workflows/release-sponsored-txs-docker.yml @@ -30,7 +30,7 @@ jobs: registry: ${{ env.REGISTRY }} username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Extract tag from package.json + - name: Extract tag from package.json and Cargo.toml files id: meta run: | export FRONTEND_VERSION=$(jq -r .version sponsoredTransactions/frontend/package.json) From b74495443fdeed71e07a064f2ea44b039cd7b083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Bizjak?= Date: Thu, 11 Apr 2024 09:54:06 +0200 Subject: [PATCH 07/13] Remove duplicate job. --- .../workflows/release-euroe-demo-docker.yml | 53 ------------------- 1 file changed, 53 deletions(-) delete mode 100644 .github/workflows/release-euroe-demo-docker.yml diff --git a/.github/workflows/release-euroe-demo-docker.yml b/.github/workflows/release-euroe-demo-docker.yml deleted file mode 100644 index 0d43efc8..00000000 --- a/.github/workflows/release-euroe-demo-docker.yml +++ /dev/null @@ -1,53 +0,0 @@ -# This job builds and publishes a docker image for the euroe demo dApp to -# the dockerhub image repository. -name: Create and publish a Docker image for the euroe demo dApp. - -on: - workflow_dispatch: # allows manual trigger - - push: - tags: - - 'euroe-demo/*.*.*' - -env: - REGISTRY: docker.io - IMAGE_NAME: dapp-euroe-demo - -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 euroe-demo/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 - 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: ./euroe-demo - file: ./euroe-demo/scripts/Dockerfile - push: true - platforms: linux/amd64 - tags: ${{ steps.meta.outputs.tag }} \ No newline at end of file From 0639d237e5143698876ce36189efcddbb7e02c42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Bizjak?= Date: Thu, 11 Apr 2024 10:18:58 +0200 Subject: [PATCH 08/13] Don't run workflow if tags don't match. --- .../release-auction-sponsored-txs-docker.yml | 11 ++++++++--- .github/workflows/release-sponsored-txs-docker.yml | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-auction-sponsored-txs-docker.yml b/.github/workflows/release-auction-sponsored-txs-docker.yml index 056f7f5a..206ee201 100644 --- a/.github/workflows/release-auction-sponsored-txs-docker.yml +++ b/.github/workflows/release-auction-sponsored-txs-docker.yml @@ -8,11 +8,12 @@ on: push: tags: # The versioning is of the format: `frontend_version-backend_version`. - - 'cis2-sponsored-transactions/*.*.*-*.*.*' + - 'cis2-auction-sponsored-txs/*.*.*-*.*.*' env: REGISTRY: docker.io IMAGE_NAME: dapp-auction-sponsored-txs + EXPECTED_TAG: ${{ github.ref_name }} jobs: build-and-push-image: @@ -35,12 +36,16 @@ jobs: run: | export FRONTEND_VERSION=$(jq -r .version sponsoredTransactionsAuction/frontend/package.json) export BACKEND_VERSION=$(yq .package.version sponsoredTransactionsAuction/backend/Cargo.toml) - export FULL_IMAGE_TAG="${{ env.REGISTRY }}/concordium/$IMAGE_NAME:$FRONTEND_VERSION-$BACKEND_VERSION" + 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" @@ -52,4 +57,4 @@ jobs: file: ./sponsoredTransactionsAuction/Dockerfile push: true platforms: linux/amd64 - tags: ${{ steps.meta.outputs.tag }} \ No newline at end of file + tags: ${{ steps.meta.outputs.tag }} diff --git a/.github/workflows/release-sponsored-txs-docker.yml b/.github/workflows/release-sponsored-txs-docker.yml index cab5cc4a..e2ea0daa 100644 --- a/.github/workflows/release-sponsored-txs-docker.yml +++ b/.github/workflows/release-sponsored-txs-docker.yml @@ -52,4 +52,4 @@ jobs: file: ./sponsoredTransactions/Dockerfile push: true platforms: linux/amd64 - tags: ${{ steps.meta.outputs.tag }} \ No newline at end of file + tags: ${{ steps.meta.outputs.tag }} From 2c7dfa93d4fc1c08ffb6104d2bada1c9135b01c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Bizjak?= Date: Thu, 11 Apr 2024 14:28:08 +0200 Subject: [PATCH 09/13] Gallery. --- .github/workflows/release-gallery-docker.yml | 5 ++++- gallery/package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-gallery-docker.yml b/.github/workflows/release-gallery-docker.yml index 79ca4d65..311bc56e 100644 --- a/.github/workflows/release-gallery-docker.yml +++ b/.github/workflows/release-gallery-docker.yml @@ -39,6 +39,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 }}" = "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" @@ -50,4 +53,4 @@ jobs: file: gallery/Dockerfile push: true platforms: linux/amd64 - tags: ${{ steps.meta.outputs.tag }} \ No newline at end of file + tags: ${{ steps.meta.outputs.tag }} 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", From 7c3da7176fd8386810b2f565d97d17e39ef7c232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Bizjak?= Date: Thu, 11 Apr 2024 14:30:29 +0200 Subject: [PATCH 10/13] Signmessage. --- .github/workflows/release-sign-message-docker.yml | 5 ++++- signMessage/package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-sign-message-docker.yml b/.github/workflows/release-sign-message-docker.yml index 8280d4d8..d622c965 100644 --- a/.github/workflows/release-sign-message-docker.yml +++ b/.github/workflows/release-sign-message-docker.yml @@ -39,6 +39,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 }}" = "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" @@ -50,4 +53,4 @@ jobs: file: ./signMessage/Dockerfile push: true platforms: linux/amd64 - tags: ${{ steps.meta.outputs.tag }} \ No newline at end of file + tags: ${{ steps.meta.outputs.tag }} 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", From 938e7a9b42ebf22355a21aad0f909a1bffa18446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Bizjak?= Date: Thu, 11 Apr 2024 14:32:10 +0200 Subject: [PATCH 11/13] Simple age verification. --- .github/workflows/release-simple-age-verification-docker.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-simple-age-verification-docker.yml b/.github/workflows/release-simple-age-verification-docker.yml index 4b1eff4a..2cea171a 100644 --- a/.github/workflows/release-simple-age-verification-docker.yml +++ b/.github/workflows/release-simple-age-verification-docker.yml @@ -39,6 +39,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 }}" = "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" @@ -50,4 +53,4 @@ jobs: file: ./simpleAgeVerification/Dockerfile push: true platforms: linux/amd64 - tags: ${{ steps.meta.outputs.tag }} \ No newline at end of file + tags: ${{ steps.meta.outputs.tag }} From 46ff9fa92607ac6a45a197c0516188075a7af01e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Bizjak?= Date: Thu, 11 Apr 2024 14:33:17 +0200 Subject: [PATCH 12/13] Sponsored transactions. --- .github/workflows/release-sponsored-txs-docker.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-sponsored-txs-docker.yml b/.github/workflows/release-sponsored-txs-docker.yml index e2ea0daa..ee4d9d88 100644 --- a/.github/workflows/release-sponsored-txs-docker.yml +++ b/.github/workflows/release-sponsored-txs-docker.yml @@ -35,12 +35,16 @@ jobs: run: | export FRONTEND_VERSION=$(jq -r .version sponsoredTransactions/frontend/package.json) export BACKEND_VERSION=$(yq .package.version sponsoredTransactions/backend/Cargo.toml) - export FULL_IMAGE_TAG="${{ env.REGISTRY }}/concordium/$IMAGE_NAME:$FRONTEND_VERSION-$BACKEND_VERSION" + 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" From 0b1c914f2e105c37356b53e284bf0180f811e4cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Bizjak?= Date: Thu, 11 Apr 2024 14:34:33 +0200 Subject: [PATCH 13/13] EuroE demo. --- .github/workflows/release-euro-demo.yml | 3 +++ 1 file changed, 3 insertions(+) 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"