Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
dinkar-jain committed Feb 12, 2025
2 parents 93f5176 + d82147a commit ce58226
Show file tree
Hide file tree
Showing 16 changed files with 220 additions and 112 deletions.
4 changes: 2 additions & 2 deletions .github/actions/gradle-setup-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ runs:
with:
distribution: 'temurin'
java-version: '21'
- name: Gradle wrapper validation
uses: gradle/actions/wrapper-validation@v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Gradle wrapper validation
uses: gradle/actions/wrapper-validation@v4
69 changes: 0 additions & 69 deletions .github/workflows/build-docker.yml

This file was deleted.

27 changes: 22 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,33 @@ on:
branches-ignore:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
version:
uses: walt-id/waltid-identity/.github/workflows/version.yml@266f5c09359450c39019a6da38f2b331e7122918
gradle-build:
uses: walt-id/waltid-identity/.github/workflows/build-gradle.yml@266f5c09359450c39019a6da38f2b331e7122918
uses: walt-id/waltid-identity/.github/workflows/gradle.yml@d3e3284f901bef1e6d80b35720fbae5e4b49a95a
needs: version
with:
version: ${{ needs.version.outputs.release_version }}
docker-build:
uses: walt-id/waltid-identity/.github/workflows/build-docker.yml@266f5c09359450c39019a6da38f2b331e7122918
needs: version
docker-matrix:
uses: walt-id/waltid-identity/.github/workflows/load-json.yml@927c4233610e90dd8a57418662fad7293b7b29a4
with:
jsonpath: ".github/workflows/data/docker-matrix.json"
docker:
uses: walt-id/waltid-identity/.github/workflows/docker.yml@a82cb3363b9ffc14fde08d787383318f83cb99be
needs: [ version, docker-matrix ]
with:
images: ${{ needs.docker-matrix.outputs.json }}
version: ${{ needs.version.outputs.release_version }}
artifact: true
ebsi-ct-v3:
uses: walt-id/waltid-identity/.github/workflows/ebsictv3.yml@a82cb3363b9ffc14fde08d787383318f83cb99be
needs: [ version, docker ]
secrets: inherit
with:
version: ${{ needs.version.outputs.release_version }}
artifact: issuer-api
tag: "waltid/issuer-api:${{ needs.version.outputs.release_version }}"
26 changes: 26 additions & 0 deletions .github/workflows/data/docker-matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"folder": "waltid-services/waltid-issuer-api",
"image": "issuer-api"
},
{
"folder": "waltid-services/waltid-verifier-api",
"image": "verifier-api"
},
{
"folder": "waltid-services/waltid-wallet-api",
"image": "wallet-api"
},
{
"folder": "waltid-applications/waltid-web-wallet/apps/waltid-demo-wallet",
"image": "waltid-demo-wallet"
},
{
"folder": "waltid-applications/waltid-web-wallet/apps/waltid-dev-wallet",
"image": "waltid-dev-wallet"
},
{
"folder": "waltid-applications/waltid-web-portal",
"image": "portal"
}
]
1 change: 0 additions & 1 deletion .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ on:

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
env:
IMAGE_TAG: ${{ inputs.version }}
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build and/or push docker (reusable workflow)

on:
workflow_call:
inputs:
images:
description: "The json array specifying image data (built with prepare-docker workflow)"
required: true
type: string
version:
description: "release version"
required: true
type: string
tag:
description: "desired tag, e.g. latest, dev (defaults to dev)"
required: false
type: string
default: "dev"
publish:
description: "Specifies whether to publish the images (defaults to false)"
required: false
type: boolean
default: false
artifact:
description: "Upload docker artifact (defaults to false)"
required: false
type: boolean
default: false

jobs:
docker:
runs-on: ubuntu-latest
strategy:
matrix:
include: ${{ fromJSON(inputs.images) }}
steps:
- run: |
echo "${{ matrix.image }}::: ${{ inputs.tag }} / ${{ inputs.version }}"
- uses: actions/checkout@v4
- name: Login to Docker Hub
if: ${{ inputs.publish }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker images (${{ matrix.image }})
uses: docker/build-push-action@v6
with:
push: ${{ inputs.publish }}
file: ${{ matrix.folder }}/Dockerfile
tags: waltid/${{ matrix.image }}:${{ inputs.tag }}, waltid/${{ matrix.image }}:${{ inputs.version }}
load: true
build-args: |
--progress=plain
continue-on-error: false
- name: Save Docker Image to ${{ matrix.image }}.tar.gz
if: ${{ inputs.artifact }}
run: docker save waltid/${{ matrix.image }}:${{ inputs.version }} | gzip > ${{ runner.temp }}/${{ matrix.image }}.tar.gz
continue-on-error: false
- name: Upload artifact
if: ${{ inputs.artifact }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.image }}
path: ${{ runner.temp }}/${{ matrix.image }}.tar.gz
retention-days: 1
50 changes: 39 additions & 11 deletions .github/workflows/ebsictv3.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
name: EBSI Conformance Test v3.2

on:
push:
paths:
- 'waltid-libraries/credentials/**'
- 'waltid-libraries/crypto/**'
- 'waltid-libraries/protocols/**'
- 'waltid-libraries/waltid-did/**'
- 'waltid-services/services/waltid-issuer-api/**'
- '.github/workflows/**'
workflow_call:
inputs:
artifact:
description: "Load image from this artifact (defaults to empty)"
required: false
type: string
path:
description: "Specifies the artifact path (defaults to empty)"
required: false
type: string
tag:
description: "Use this docker image tag (defaults to empty)"
required: false
type: string

jobs:
EBSI-Conformance-Test-v3:
name: Run
runs-on: ubuntu-latest
env:
use-artifact: ${{ inputs.artifact != '' && inputs.tag != '' }}
steps:
- name: The EBSI Conformance Test v3.2 job is starting
run: |
Expand All @@ -32,6 +41,20 @@ jobs:
- name: Docker
run: docker --version

- name: Download artifact
if: ${{ env.use-artifact }}
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact }}
path: ${{ runner.temp }}

- name: Unzip ${{ inputs.artifact }}.tar.gz
run: gunzip ${{ runner.temp }}/${{ inputs.artifact }}.tar.gz
- name: Load Docker image from tarball
if: ${{ env.use-artifact }}
run: |
docker load --input ${{ runner.temp }}/${{ inputs.artifact }}.tar
- name: Check out repository code
uses: actions/checkout@v4

Expand All @@ -53,9 +76,14 @@ jobs:
sed -i 's|readonly ISSUER_URL=".*"|readonly ISSUER_URL="'"${NGROK_URL}"'"|g' .github/workflows/ebsictv3/EBSICTV3-IssueToHolder.sh
sed -i 's|baseUrl = ".*"|baseUrl = "'"${NGROK_URL}"'"|g' waltid-services/waltid-issuer-api/config/issuer-service.conf
docker build -t waltid/issuer-api:latest -f waltid-services/waltid-issuer-api/Dockerfile .
docker run --net=host -d -v $PWD/waltid-services/waltid-issuer-api/config:/waltid-issuer-api/config --name waltid-issuer-api waltid/issuer-api:latest
image="${{ inputs.tag }}"
if [[ "${{ env.use-artifact }}" != "true" ]]; then
image="waltid/issuer-api:latest"
docker build -t $image -f waltid-services/waltid-issuer-api/Dockerfile .
fi
docker run --net=host -d -v $PWD/waltid-services/waltid-issuer-api/config:/waltid-issuer-api/config --name waltid-issuer-api $image
curl --retry 5 --retry-delay 5 --retry-connrefused http://localhost:7002/livez
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ on:
default: false

jobs:
build:
name: Build
gradle:
runs-on: ubuntu-latest
steps:
- name: Free Disk Space (Ubuntu)
Expand All @@ -26,7 +25,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: Configure gradle
uses: ./.github/actions/gradle-setup-action@266f5c09359450c39019a6da38f2b331e7122918
uses: walt-id/waltid-identity/.github/actions/gradle-setup-action@f7b46c8ae1c27f1a0873a5ca8dfb0440c77381ec
- name: Set version
run: |
sed -i "s/1.0.0-SNAPSHOT/${{ inputs.version }}/g" build.gradle.kts
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/load-json.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Load json

on:
workflow_call:
inputs:
jsonpath:
description: "the json file path containing the matrix"
required: true
type: string
outputs:
json:
description: "The json data"
value: ${{ jobs.load-json.outputs.result }}

jobs:
load-json:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.load-json.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: load-json
run: |
echo "matrix=$(jq -c . < ${{ inputs.jsonpath }})" >> $GITHUB_OUTPUT
17 changes: 11 additions & 6 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,28 @@ jobs:
uses: walt-id/waltid-identity/.github/workflows/version.yml@266f5c09359450c39019a6da38f2b331e7122918
with:
suffix: -SNAPSHOT
gradle-build:
uses: walt-id/waltid-identity/.github/workflows/build-gradle.yml@266f5c09359450c39019a6da38f2b331e7122918
gradle:
uses: walt-id/waltid-identity/.github/workflows/gradle.yml@d3e3284f901bef1e6d80b35720fbae5e4b49a95a
secrets: inherit
needs: version
with:
version: ${{ needs.version.outputs.release_version }}
publish: true
docker-build:
uses: walt-id/waltid-identity/.github/workflows/build-docker.yml@266f5c09359450c39019a6da38f2b331e7122918
docker-matrix:
uses: walt-id/waltid-identity/.github/workflows/load-json.yml@927c4233610e90dd8a57418662fad7293b7b29a4
with:
jsonpath: ".github/workflows/data/docker-matrix.json"
docker:
uses: walt-id/waltid-identity/.github/workflows/docker.yml@a82cb3363b9ffc14fde08d787383318f83cb99be
secrets: inherit
needs: version
needs: [ version, docker-matrix ]
with:
images: ${{ needs.docker-matrix.outputs.json }}
version: ${{ needs.version.outputs.release_version }}
publish: true
tag:
uses: walt-id/waltid-identity/.github/workflows/tag.yml@266f5c09359450c39019a6da38f2b331e7122918
needs: [ version, gradle-build, docker-build ]
needs: [ version, gradle, docker ]
with:
version: ${{ needs.version.outputs.release_version }}
pre-release:
Expand Down
Loading

0 comments on commit ce58226

Please sign in to comment.