From b8cbc3cbbb5f0ba47f7c79bdd791f3efc0f5e303 Mon Sep 17 00:00:00 2001 From: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> Date: Wed, 28 May 2025 06:51:14 +0700 Subject: [PATCH 1/4] Add .circleci/config.yml --- .circleci/config.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..62291703 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,31 @@ +# Use the latest 2.1 version of CircleCI pipeline process engine. +# See: https://circleci.com/docs/configuration-reference +version: 2.1 + +# Define a job to be invoked later in a workflow. +# See: https://circleci.com/docs/jobs-steps/#jobs-overview & https://circleci.com/docs/configuration-reference/#jobs +jobs: + say-hello: + # Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub. + # See: https://circleci.com/docs/executor-intro/ & https://circleci.com/docs/configuration-reference/#executor-job + docker: + # Specify the version you desire here + # See: https://circleci.com/developer/images/image/cimg/base + - image: cimg/base:current + + # Add steps to the job + # See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps + steps: + # Checkout the code as the first step. + - checkout + - run: + name: "Say hello" + command: "echo Hello, World!" + +# Orchestrate jobs using workflows +# See: https://circleci.com/docs/workflows/ & https://circleci.com/docs/configuration-reference/#workflows +workflows: + say-hello-workflow: # This is the name of the workflow, feel free to change it to better match your workflow. + # Inside the workflow, you define the jobs you want to run. + jobs: + - say-hello \ No newline at end of file From f1f0f14cac035a54358f11c0cb3f1eb010e1f58b Mon Sep 17 00:00:00 2001 From: Dargon789 <64915515+Dargon789@users.noreply.github.com> Date: Sat, 29 Nov 2025 06:37:04 +0700 Subject: [PATCH 2/4] Create google.yml (#13) Static Code Analysis (readability, compactness): Dynamic Code Analysis (external APIs, interaction flows): Efficiency (gas costs, computational complexity, memory requirements): Opinion, trade-offs and other thoughts (optional): Summary by Sourcery Deployment: Introduce a Google Cloud deployment workflow that builds a Docker image, pushes it to Artifact Registry, and deploys it to a GKE cluster on pushes to the main branch. Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> --- .github/workflows/google.yml | 116 +++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 .github/workflows/google.yml diff --git a/.github/workflows/google.yml b/.github/workflows/google.yml new file mode 100644 index 00000000..3ab19274 --- /dev/null +++ b/.github/workflows/google.yml @@ -0,0 +1,116 @@ +# This workflow will build a docker container, publish it to Google Container +# Registry, and deploy it to GKE when there is a push to the "main" +# branch. +# +# To configure this workflow: +# +# 1. Enable the following Google Cloud APIs: +# +# - Artifact Registry (artifactregistry.googleapis.com) +# - Google Kubernetes Engine (container.googleapis.com) +# - IAM Credentials API (iamcredentials.googleapis.com) +# +# You can learn more about enabling APIs at +# https://support.google.com/googleapi/answer/6158841. +# +# 2. Ensure that your repository contains the necessary configuration for your +# Google Kubernetes Engine cluster, including deployment.yml, +# kustomization.yml, service.yml, etc. +# +# 3. Create and configure a Workload Identity Provider for GitHub: +# https://github.com/google-github-actions/auth#preferred-direct-workload-identity-federation. +# +# Depending on how you authenticate, you will need to grant an IAM principal +# permissions on Google Cloud: +# +# - Artifact Registry Administrator (roles/artifactregistry.admin) +# - Kubernetes Engine Developer (roles/container.developer) +# +# You can learn more about setting IAM permissions at +# https://cloud.google.com/iam/docs/manage-access-other-resources +# +# 5. Change the values in the "env" block to match your values. + +name: "Build and Deploy to GKE" +on: + push: + branches: + - '"main"' + +env: + PROJECT_ID: "my-project" # TODO: update to your Google Cloud project ID + GAR_LOCATION: "us-central1" # TODO: update to your region + GKE_CLUSTER: "cluster-1" # TODO: update to your cluster name + GKE_ZONE: "us-central1-c" # TODO: update to your cluster zone + DEPLOYMENT_NAME: "gke-test" # TODO: update to your deployment name + REPOSITORY: "samples" # TODO: update to your Artifact Registry docker repository name + IMAGE: "static-site" + WORKLOAD_IDENTITY_PROVIDER: "projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider" # TODO: update to your workload identity provider + +jobs: + setup-build-publish-deploy: + name: "Setup, Build, Publish, and Deploy" + runs-on: "ubuntu-latest" + environment: "production" + + permissions: + contents: "read" + id-token: "write" + + steps: + - name: "Checkout" + uses: "actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332" # actions/checkout@v4 + + # Configure Workload Identity Federation and generate an access token. + # + # See https://github.com/google-github-actions/auth for more options, + # including authenticating via a JSON credentials file. + - id: "auth" + name: "Authenticate to Google Cloud" + uses: "google-github-actions/auth@f112390a2df9932162083945e46d439060d66ec2" # google-github-actions/auth@v2 + with: + workload_identity_provider: "${{ env.WORKLOAD_IDENTITY_PROVIDER }}" + + # Authenticate Docker to Google Cloud Artifact Registry + - name: "Docker Auth" + uses: "docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567" # docker/login-action@v3 + with: + username: "oauth2accesstoken" + password: "${{ steps.auth.outputs.auth_token }}" + registry: "${{ env.GAR_LOCATION }}-docker.pkg.dev" + + # Get the GKE credentials so we can deploy to the cluster + - name: "Set up GKE credentials" + uses: "google-github-actions/get-gke-credentials@6051de21ad50fbb1767bc93c11357a49082ad116" # google-github-actions/get-gke-credentials@v2 + with: + cluster_name: "${{ env.GKE_CLUSTER }}" + location: "${{ env.GKE_ZONE }}" + + # Build the Docker image + - name: "Build and push Docker container" + run: |- + DOCKER_TAG="${GAR_LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPOSITORY}/${IMAGE}:${GITHUB_SHA}" + + docker build \ + --tag "${DOCKER_TAG}" \ + --build-arg GITHUB_SHA="${GITHUB_SHA}" \ + --build-arg GITHUB_REF="${GITHUB_REF}" \ + . + + docker push "${DOCKER_TAG}" + + # Set up kustomize + - name: "Set up Kustomize" + run: |- + curl -sfLo kustomize https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.4.3/kustomize_v5.4.3_linux_amd64.tar.gz + chmod u+x ./kustomize + + # Deploy the Docker image to the GKE cluster + - name: "Deploy to GKE" + run: |- + # replacing the image name in the k8s template + ./kustomize edit set image LOCATION-docker.pkg.dev/PROJECT_ID/REPOSITORY/IMAGE:TAG=$GAR_LOCATION-docker.pkg.dev/$PROJECT_ID/$REPOSITORY/$IMAGE:$GITHUB_SHA + ./kustomize build . | kubectl apply -f - + kubectl rollout status deployment/$DEPLOYMENT_NAME + kubectl get services -o wide + From 93d4b9ea1378cd8685df8943443d979b7b9dbe57 Mon Sep 17 00:00:00 2001 From: Dargon789 <64915515+Dargon789@users.noreply.github.com> Date: Wed, 1 Jul 2026 03:22:43 +0700 Subject: [PATCH 3/4] Delete .circleci directory (#29) CI: Drop CircleCI workflow configuration by removing .circleci/config.yml from the repository. Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> --- .circleci/config.yml | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 62291703..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,31 +0,0 @@ -# Use the latest 2.1 version of CircleCI pipeline process engine. -# See: https://circleci.com/docs/configuration-reference -version: 2.1 - -# Define a job to be invoked later in a workflow. -# See: https://circleci.com/docs/jobs-steps/#jobs-overview & https://circleci.com/docs/configuration-reference/#jobs -jobs: - say-hello: - # Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub. - # See: https://circleci.com/docs/executor-intro/ & https://circleci.com/docs/configuration-reference/#executor-job - docker: - # Specify the version you desire here - # See: https://circleci.com/developer/images/image/cimg/base - - image: cimg/base:current - - # Add steps to the job - # See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps - steps: - # Checkout the code as the first step. - - checkout - - run: - name: "Say hello" - command: "echo Hello, World!" - -# Orchestrate jobs using workflows -# See: https://circleci.com/docs/workflows/ & https://circleci.com/docs/configuration-reference/#workflows -workflows: - say-hello-workflow: # This is the name of the workflow, feel free to change it to better match your workflow. - # Inside the workflow, you define the jobs you want to run. - jobs: - - say-hello \ No newline at end of file From 00dc6ee0b7af8924c72cc4fd65aa5a306312a88c Mon Sep 17 00:00:00 2001 From: Dargon789 <64915515+Dargon789@users.noreply.github.com> Date: Wed, 1 Jul 2026 07:33:08 +0700 Subject: [PATCH 4/4] Bump hardhat-ethers (#30) * fix: upgrade @openzeppelin/contracts from 5.1.0 to 5.5.0 (#5) Snyk has created this PR to upgrade @openzeppelin/contracts from 5.1.0 to 5.5.0. See this package in yarn: @openzeppelin/contracts See this project in Snyk: https://app.snyk.io/org/apichanmittare/project/c7ee47d0-df1f-42cb-a2d3-9ac1f38d2e71?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade dotenv from 16.4.5 to 16.6.1 (#7) Snyk has created this PR to upgrade dotenv from 16.4.5 to 16.6.1. See this package in yarn: dotenv See this project in Snyk: https://app.snyk.io/org/apichanmittare/project/c7ee47d0-df1f-42cb-a2d3-9ac1f38d2e71?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot * fix: upgrade @nomicfoundation/hardhat-ethers from 3.0.8 to 3.1.2 Snyk has created this PR to upgrade @nomicfoundation/hardhat-ethers from 3.0.8 to 3.1.2. See this package in yarn: @nomicfoundation/hardhat-ethers See this project in Snyk: https://app.snyk.io/org/apichanmittare/project/c7ee47d0-df1f-42cb-a2d3-9ac1f38d2e71?utm_source=github&utm_medium=referral&page=upgrade-pr * fix: upgrade ethers from 6.13.4 to 6.15.0 Snyk has created this PR to upgrade ethers from 6.13.4 to 6.15.0. See this package in yarn: ethers See this project in Snyk: https://app.snyk.io/org/apichanmittare/project/c7ee47d0-df1f-42cb-a2d3-9ac1f38d2e71?utm_source=github&utm_medium=referral&page=upgrade-pr * fix: package.json to reduce vulnerabilities (#3) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-JSYAML-13961110 Co-authored-by: snyk-io[bot] <141718529+snyk-io[bot]@users.noreply.github.com> * Update package.json Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> * Delete .circleci directory Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> --------- Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> Co-authored-by: snyk-bot Co-authored-by: snyk-io[bot] <141718529+snyk-io[bot]@users.noreply.github.com> Co-authored-by: googleworkspace-bot Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- package.json | 8 ++++---- yarn.lock | 32 ++++++++++++++++---------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index 272f3d6e..2698e9ca 100644 --- a/package.json +++ b/package.json @@ -41,15 +41,15 @@ }, "dependencies": { "@metamask/eth-sig-util": "8.0.0", - "@nomicfoundation/hardhat-ethers": "3.0.8", + "@nomicfoundation/hardhat-ethers": "3.1.2", "@nomicfoundation/hardhat-network-helpers": "1.0.12", "@nomicfoundation/hardhat-verify": "2.0.14", - "@openzeppelin/contracts": "5.1.0", + "@openzeppelin/contracts": "5.5.0", "@uniswap/permit2-sdk": "1.3.0", "chai": "4.5.0", - "dotenv": "16.4.5", + "dotenv": "16.6.1", "ethereumjs-util": "7.1.5", - "ethers": "6.13.4", + "ethers": "6.15.0", "hardhat": "2.23.0", "hardhat-deploy": "0.14.0", "mocha-chai-jest-snapshot": "1.1.6", diff --git a/yarn.lock b/yarn.lock index 34848ca4..f3c5f830 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1397,10 +1397,10 @@ deep-eql "^4.0.1" ordinal "^1.0.3" -"@nomicfoundation/hardhat-ethers@3.0.8": - version "3.0.8" - resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-ethers/-/hardhat-ethers-3.0.8.tgz#af078f566373abeb77e11cbe69fe3dd47f8bfc27" - integrity sha512-zhOZ4hdRORls31DTOqg+GmEZM0ujly8GGIuRY7t7szEk2zW/arY1qDug/py8AEktT00v5K+b6RvbVog+va51IA== +"@nomicfoundation/hardhat-ethers@3.1.2": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-ethers/-/hardhat-ethers-3.1.2.tgz#8f9e6ee32514e9a65b047735dca2c02c60e814ed" + integrity sha512-7xEaz2X8p47qWIAqtV2z03MmusheHm8bvY2mDlxo9JiT2BgSx59GSdv5+mzwOvsuKDbTij7oqDnwFyYOlHREEQ== dependencies: debug "^4.1.1" lodash.isequal "^4.5.0" @@ -1475,10 +1475,10 @@ "@nomicfoundation/solidity-analyzer-linux-x64-musl" "0.1.2" "@nomicfoundation/solidity-analyzer-win32-x64-msvc" "0.1.2" -"@openzeppelin/contracts@5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-5.1.0.tgz#4e61162f2a2bf414c4e10c45eca98ce5f1aadbd4" - integrity sha512-p1ULhl7BXzjjbha5aqst+QMLY+4/LCWADXOCsmLHRM77AqiPjnd9vvUN9sosUfhL9JGKpZ0TjEGxgvnizmWGSA== +"@openzeppelin/contracts@5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-5.5.0.tgz#24e8a2f9598de484dcb223512af656edf52bc0e8" + integrity sha512-R8hq4zmKKWP2c7OxeRgAcjZwvF5W0Qq2OIX7degrtdM52Q9xYr4MLJdUAVPKGUewNJ1qo+M6YiZLLnNUnjP/gg== "@pkgjs/parseargs@^0.11.0": version "0.11.0" @@ -3153,10 +3153,10 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -dotenv@16.4.5: - version "16.4.5" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.5.tgz#cdd3b3b604cb327e286b4762e13502f717cb099f" - integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg== +dotenv@16.6.1: + version "16.6.1" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.6.1.tgz#773f0e69527a8315c7285d5ee73c4459d20a8020" + integrity sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow== dunder-proto@^1.0.0, dunder-proto@^1.0.1: version "1.0.1" @@ -3623,10 +3623,10 @@ ethereumjs-util@7.1.5, ethereumjs-util@^7.1.4: ethereum-cryptography "^0.1.3" rlp "^2.2.4" -ethers@6.13.4: - version "6.13.4" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.13.4.tgz#bd3e1c3dc1e7dc8ce10f9ffb4ee40967a651b53c" - integrity sha512-21YtnZVg4/zKkCQPjrDj38B1r4nQvTZLopUGMLQ1ePU2zV/joCfDC3t3iKQjWRzjjjbzR+mdAIoikeBRNkdllA== +ethers@6.15.0: + version "6.15.0" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.15.0.tgz#2980f2a3baf0509749b7e21f8692fa8a8349c0e3" + integrity sha512-Kf/3ZW54L4UT0pZtsY/rf+EkBU7Qi5nnhonjUb8yTXcxH3cdcWrV2cRyk0Xk/4jK6OoHhxxZHriyhje20If2hQ== dependencies: "@adraffy/ens-normalize" "1.10.1" "@noble/curves" "1.2.0"