refactor: split OID4VC monolith and overhaul storage layer #986
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: WalletFramework CI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| - 'release/**' | |
| env: | |
| BUILD_CONFIG: 'Release' | |
| SOLUTION: 'src/WalletFramework.sln' | |
| IS_PULL_REQUEST: ${{ github.event_name == 'pull_request' }} | |
| IS_DEVELOP_BRANCH: ${{ github.ref == 'refs/heads/develop' }} | |
| IS_RELEASE_BRANCH: ${{ startsWith(github.ref, 'refs/heads/release/') }} | |
| IS_MAIN_BRANCH: ${{ github.ref == 'refs/heads/main' }} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set Version | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y libxml2-utils jq | |
| VERSION=$(xmllint --xpath "string(/Project/PropertyGroup/Version)" Directory.Build.props) | |
| SUFFIX="" | |
| if $IS_MAIN_BRANCH; then | |
| SUFFIX="" | |
| elif $IS_RELEASE_BRANCH; then | |
| WORKFLOW_ID=$(gh workflow list --json name,id -q ".[] | select(.name == \"${{ github.workflow }}\") | .id") | |
| echo "workflowID is $WORKFLOW_ID" | |
| RUN_COUNT=$(gh run list --workflow "$WORKFLOW_ID" --branch "${{ github.ref_name }}" --json status -q "[.[] | select(.status != \"in_progress\" and .status != \"queued\")] | length") | |
| echo "run count is $RUN_COUNT" | |
| RC_NUMBER=$((RUN_COUNT + 1)) | |
| echo "RC_NUMBER=$RC_NUMBER" >> $GITHUB_OUTPUT | |
| SUFFIX="-rc.$RC_NUMBER" | |
| elif $IS_DEVELOP_BRANCH; then | |
| RUN_NUMBER=${{ github.run_number }} | |
| SUFFIX="-dev.$RUN_NUMBER" | |
| elif $IS_PULL_REQUEST; then | |
| PR_NUMBER=${{ github.event.pull_request.number }} | |
| COMMIT_COUNT=$(git rev-list --count HEAD) | |
| SUFFIX="-pr.$PR_NUMBER.$COMMIT_COUNT" | |
| fi | |
| echo "APP_VERSION=$VERSION$SUFFIX" >> $GITHUB_ENV | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| global-json-file: src/global.json | |
| - name: Restore dependencies | |
| run: dotnet restore $SOLUTION | |
| - name: Build | |
| run: dotnet build $SOLUTION --configuration $BUILD_CONFIG -p:Version=$APP_VERSION | |
| - name: Run tests | |
| run: | | |
| dotnet test test/WalletFramework.Core.Tests/WalletFramework.Core.Tests.csproj --configuration $BUILD_CONFIG --no-restore --no-build | |
| dotnet test test/WalletFramework.MdocLib.Tests/WalletFramework.MdocLib.Tests.csproj --configuration $BUILD_CONFIG --no-restore --no-build | |
| dotnet test test/WalletFramework.MdocVc.Tests/WalletFramework.MdocVc.Tests.csproj --configuration $BUILD_CONFIG --no-restore --no-build | |
| dotnet test test/WalletFramework.Oid4Vp.Tests/WalletFramework.Oid4Vp.Tests.csproj --configuration $BUILD_CONFIG --no-restore --no-build | |
| dotnet test test/WalletFramework.Oid4Vci.Tests/WalletFramework.Oid4Vci.Tests.csproj --configuration $BUILD_CONFIG --no-restore --no-build | |
| dotnet test test/WalletFramework.SdJwtVc.Tests/WalletFramework.SdJwtVc.Tests.csproj --configuration $BUILD_CONFIG --no-restore --no-build | |
| dotnet test test/WalletFramework.SdJwtLib.Tests/WalletFramework.SdJwtLib.Tests.csproj --configuration $BUILD_CONFIG --no-restore --no-build | |
| dotnet test test/WalletFramework.Storage.Tests/WalletFramework.Storage.Tests.csproj --configuration $BUILD_CONFIG --no-restore --no-build | |
| - name: Pack WalletFramework | |
| run: dotnet pack $SOLUTION --configuration $BUILD_CONFIG -p:Version=$APP_VERSION --no-build --output . | |
| - name: Publish to NuGet | |
| if: env.IS_PULL_REQUEST == 'false' && (env.IS_MAIN_BRANCH == 'true' || env.IS_RELEASE_BRANCH == 'true' || env.IS_DEVELOP_BRANCH == 'true') | |
| run: dotnet nuget push "**/*.nupkg" --source 'https://api.nuget.org/v3/index.json' --api-key ${{ secrets.NUGET_API_KEY }} |