Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/PID-2319-use-resolver-as…
Browse files Browse the repository at this point in the history
…-oracle-data-solution' into feature/PID-2319-use-resolver-as-oracle-data-solution
  • Loading branch information
Andriian Chestnykh committed Aug 13, 2024
2 parents 09f8a7f + 6a3655e commit 65d8741
Show file tree
Hide file tree
Showing 4 changed files with 213 additions and 34 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ jobs:
newman run tests/e2e/http_nameservice.postman_collection.json \
-g ./tests/e2e/dev_env.json \
--global-var issuer_server=${{ secrets.ISSUER_URL }} \
--global-var username=${{ secrets.ISSUER_NODE_USER }} \
--global-var password=${{ secrets.ISSUER_NODE_PASSWROD }} \
--bail --verbose
- name: Run state tests
Expand Down
79 changes: 79 additions & 0 deletions .github/workflows/publis-container-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Publish driver-did-iden3 to Privado AWS ECR
on:
push:
tags:
- 'v*.*.*-dev'
workflow_dispatch:

env:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID_PRIVADO_ID }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION_PRIVADO_ID }}
ECR_REPOSITORY: driver-did-iden3

jobs:
build_driver:
env:
STATE_CONTRACT_ADDRESS_POLYGON_MAIN: "0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D"
STATE_CONTRACT_ADDRESS_POLYGON_AMOY: "0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124"
STATE_CONTRACT_ADDRESS_PRIVADO_MAIN: "0x975556428F077dB5877Ea2474D783D6C69233742"
STATE_CONTRACT_ADDRESS_PRIVADO_TEST: "0x975556428F077dB5877Ea2474D783D6C69233742"
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: driver-did-iden3

- uses: actions/setup-node@v4
with:
node-version: 16

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ env.AWS_DEFAULT_REGION }}
role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/PolygonIDActionsRole
role-session-name: GitHubActionsSession

- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2
id: login-ecr

- name: Build file with supported networks
run: |
cd driver-did-iden3
echo -e "polygon:" > resolvers.settings.yaml
echo -e " amoy:" >> resolvers.settings.yaml
echo -e " contractAddress: ${{ env.STATE_CONTRACT_ADDRESS_POLYGON_AMOY }}" >> resolvers.settings.yaml
echo -e " networkURL: ${{ secrets.POLYGON_AMOY_NODE_URL }}" >> resolvers.settings.yaml
echo -e " walletKey: ${{ secrets.SIGNER_PRIVATE_KEY }}" >> resolvers.settings.yaml
echo -e " main:" >> resolvers.settings.yaml
echo -e " contractAddress: ${{ env.STATE_CONTRACT_ADDRESS_POLYGON_MAIN }}" >> resolvers.settings.yaml
echo -e " networkURL: ${{ secrets.POLYGON_MAIN_NODE_URL }}" >> resolvers.settings.yaml
echo -e " walletKey: ${{ secrets.SIGNER_PRIVATE_KEY }}" >> resolvers.settings.yaml
echo -e "privado:" >> resolvers.settings.yaml
echo -e " main:" >> resolvers.settings.yaml
echo -e " contractAddress: ${{ env.STATE_CONTRACT_ADDRESS_PRIVADO_MAIN }}" >> resolvers.settings.yaml
echo -e " networkURL: ${{ secrets.PRIVADO_MAIN_NODE_URL }}" >> resolvers.settings.yaml
echo -e " walletKey: ${{ secrets.SIGNER_PRIVATE_KEY }}" >> resolvers.settings.yaml
echo -e " test:" >> resolvers.settings.yaml
echo -e " contractAddress: ${{ env.STATE_CONTRACT_ADDRESS_PRIVADO_TEST }}" >> resolvers.settings.yaml
echo -e " networkURL: ${{ secrets.PRIVADO_TEST_NODE_URL }}" >> resolvers.settings.yaml
echo -e " walletKey: ${{ secrets.SIGNER_PRIVATE_KEY }}" >> resolvers.settings.yaml
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

- name: build and deploy to DockerHub
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{ env.ECR_REPOSITORY }}
run: |
cd driver-did-iden3 && \
docker buildx build --push \
--platform linux/amd64,linux/arm64 \
-t ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ github.ref_name }} .
16 changes: 10 additions & 6 deletions .github/workflows/push-container.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# This workflow builds a docker image and pushes it to GitHub Container Registry
# We need to have this image in public registry for compatibility with universal resolver
name: Publish driver-did-iden3
on:
release:
types: [published]
push:
tags:
- '!v*.*.*-dev'
- 'v*'
workflow_dispatch:

jobs:
build_driver:
env:
STATE_CONTRACT_ADDRESS_MAIN: "0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D"
STATE_CONTRACT_ADDRESS_AMOY: "0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124"
STATE_CONTRACT_ADDRESS_POLYGON_MAIN: "0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D"
STATE_CONTRACT_ADDRESS_POLYGON_AMOY: "0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124"
STATE_CONTRACT_ADDRESS_PRIVADO: "0x975556428F077dB5877Ea2474D783D6C69233742"
runs-on: ubuntu-latest
steps:
Expand All @@ -29,10 +33,10 @@ jobs:
cd driver-did-iden3
echo -e "polygon:" > resolvers.settings.yaml
echo -e " amoy:" >> resolvers.settings.yaml
echo -e " contractAddress: ${{ env.STATE_CONTRACT_ADDRESS_AMOY }}" >> resolvers.settings.yaml
echo -e " contractAddress: ${{ env.STATE_CONTRACT_ADDRESS_POLYGON_AMOY }}" >> resolvers.settings.yaml
echo -e " networkURL: ${{ secrets.POLYGON_AMOY_NODE_URL }}" >> resolvers.settings.yaml
echo -e " main:" >> resolvers.settings.yaml
echo -e " contractAddress: ${{ env.STATE_CONTRACT_ADDRESS_MAIN }}" >> resolvers.settings.yaml
echo -e " contractAddress: ${{ env.STATE_CONTRACT_ADDRESS_POLYGON_MAIN }}" >> resolvers.settings.yaml
echo -e " networkURL: ${{ secrets.POLYGON_MAIN_NODE_URL }}" >> resolvers.settings.yaml
echo -e "privado:" >> resolvers.settings.yaml
echo -e " main:" >> resolvers.settings.yaml
Expand Down
Loading

0 comments on commit 65d8741

Please sign in to comment.