diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7daa11c..ef728b9 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -12,10 +12,10 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'corretto' + + - name: Prepare Build Environment + uses: ./.github/workflows/prepare-build-environment + - uses: actions/cache@v4 with: path: | @@ -24,33 +24,19 @@ jobs: ~/.gradle/caches ~/.gradle/wrapper key: ${{ runner.os }}-Build-${{ hashFiles('gradlew.bat', 'src/dotnet/*/*.csproj', 'src/dotnet/*.props', 'gradle-wrapper.properties') }} + - run: ./gradlew :protocol:rdgen --no-daemon - run: ./gradlew :buildPlugin -PBuildConfiguration=Release --no-daemon + - uses: mad9000/actions-find-and-replace-string@5 id: fix_branch_name with: source: ${{ github.ref_name }} find: '/' replace: '-' + - uses: actions/upload-artifact@v4 if: github.ref_name == 'master' || github.ref_name == 'dev' with: name: odata-cli-ui.${{ steps.fix_branch_name.outputs.value }}-${{ github.run_number }} path: output - Test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - uses: actions/cache@v4 - with: - path: | - build/gradle-jvm - packages - ~/.nuget/packages - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-Test-${{ hashFiles('gradlew.bat', 'src/dotnet/*/*.csproj', 'src/dotnet/*.props', 'gradle-wrapper.properties') }} - - run: ./gradlew :protocol:rdgen --no-daemon - - run: ./gradlew :testDotNet --no-daemon diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 11480e8..462d985 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -12,10 +12,10 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'corretto' + + - name: Prepare Build Environment + uses: ./.github/workflows/prepare-build-environment + - run: ./gradlew :protocol:rdgen - run: ./gradlew :buildPlugin -PBuildConfiguration=Release - run: ./gradlew :signPlugin -PBuildConfiguration=Release @@ -23,12 +23,14 @@ jobs: CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }} PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }} + - uses: mad9000/actions-find-and-replace-string@5 id: fix_branch_name with: source: ${{ github.ref_name }} find: 'release/' replace: '' + - uses: actions/upload-artifact@v4 with: name: odata-cli-ui.${{ steps.fix_branch_name.outputs.value }} diff --git a/.github/workflows/prepare-build-environment/action.yml b/.github/workflows/prepare-build-environment/action.yml new file mode 100644 index 0000000..e938dd7 --- /dev/null +++ b/.github/workflows/prepare-build-environment/action.yml @@ -0,0 +1,16 @@ +name: "prepare-build-environment" +description: "Prepare build environment" +runs: + using: "composite" + steps: + - name: Setup JDK + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'corretto' + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' + dotnet-quality: 'ga' \ No newline at end of file