diff --git a/.github/workflows/dependency-updater-7.yml b/.github/workflows/dependency-updater-7.yml deleted file mode 100644 index 6989aeeef74..00000000000 --- a/.github/workflows/dependency-updater-7.yml +++ /dev/null @@ -1,161 +0,0 @@ -# This workflow will update dependencies for product-is 7.x.x. -name: "[Deprecated] Dependency Updater 7.x.x" -on: - workflow_dispatch: - # schedule: - # Everyday at 15:30 UTC (9.00 PM SL time) - # - cron: '30 15 * * *' - -env: - MAVEN_OPTS: -Xmx4g -Xms1g - REPOSITORY: product-is - GIT_USERNAME: jenkins-is-staging - GIT_EMAIL: jenkins-is-staging@wso2.com - PRODUCT_REPOSITORY_FORKED: $GIT_USERNAME'/'${REPOSITORY} - REMOTE_PRODUCT_REPOSITORY_PUBLIC: wso2/$REPOSITORY - PRODUCT_REPOSITORY_PUBLIC: wso2/$REPOSITORY - BUILD_NUMBER: ${{github.run_id}} - DEPENDENCY_UPGRADE_BRANCH_NAME: IS_dependency_updater_7.x.x_github_action/$BUILD_NUMBER - PR: "https://github.com/wso2/product-is/pulls" - TARGET_BRANCH_NAME: 7.x.x - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Adopt JDK 11 - uses: actions/setup-java@v2 - with: - java-version: "11" - distribution: "adopt" - - name: Check $JAVA_HOME - run: | - echo $JAVA_HOME - - name: Cache local Maven repository - id: cache-maven-m2 - uses: actions/cache@v2 - env: - cache-name: cache-m2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven-${{ env.cache-name }}- - ${{ runner.os }}-maven- - ${{ runner.os }}- - - name: Update Dependencies - id: builder_step - run: | - echo "::set-output name=REPO_NAME::${{ env.REPOSITORY }}" - echo "" - echo "Starting dependency upgrade" - echo "==========================================================" - echo "" - echo "Clean up any existing files" - echo "==========================================================" - rm -rf ${{ env.REPOSITORY }} - echo "" - echo "Cloning: https://github.com/'${{ env.PRODUCT_REPOSITORY_FORKED }}" - echo "==========================================================" - git clone 'https://github.com/'${{ env.PRODUCT_REPOSITORY_FORKED }}'.git' - cd ${{ env.REPOSITORY }} - echo "" - echo 'Add remote: '${{ env.REMOTE_PRODUCT_REPOSITORY_PUBLIC }} 'as https://github.com/'${{ env.PRODUCT_REPOSITORY_PUBLIC }} - echo "==========================================================" - git remote add ${{ env.REMOTE_PRODUCT_REPOSITORY_PUBLIC }} 'https://@github.com/'${{ env.PRODUCT_REPOSITORY_PUBLIC }} - echo "" - echo 'Fetching:' ${{ env.REMOTE_PRODUCT_REPOSITORY_PUBLIC }} - echo "==========================================================" - git fetch ${{ env.REMOTE_PRODUCT_REPOSITORY_PUBLIC }} - echo "" - echo 'Checking out:' ${{ env.REMOTE_PRODUCT_REPOSITORY_PUBLIC }} ${{ env.TARGET_BRANCH_NAME }} 'branch' - echo "==========================================================" - git checkout -b ${{ env.DEPENDENCY_UPGRADE_BRANCH_NAME }} ${{ env.REMOTE_PRODUCT_REPOSITORY_PUBLIC }}'/'${{ env.TARGET_BRANCH_NAME }} - - echo "" - echo 'Updating dependencies' - echo "==========================================================" - mvn versions:update-properties -U -DgenerateBackupPoms=false -DallowMajorUpdates=false -Dincludes=org.wso2.carbon.identity.*,org.wso2.carbon.extension.identity.*,org.wso2.identity.*,org.wso2.carbon.consent.*,org.wso2.carbon.healthcheck.*,org.wso2.carbon.utils,org.wso2.charon,org.apache.rampart.wso2,org.apache.ws.security.wso2 - echo "" - echo 'Available updates' - echo "==========================================================" - git diff --color > dependency_updates.diff - cat dependency_updates.diff - - echo "" - echo 'Build' - echo "==========================================================" - mvn clean install -Dmaven.test.failure.ignore=false | tee mvn-build.log - PR_BUILD_STATUS=$(cat mvn-build.log | grep "\[INFO\] BUILD" | grep -oE '[^ ]+$') - PR_TEST_RESULT=$(sed -n -e '/\[INFO\] Results:/,/\[INFO\] Tests run:/ p' mvn-build.log) - PR_BUILD_FINAL_RESULT=$( - echo "===========================================================" - echo "product-is BUILD $PR_BUILD_STATUS" - echo "==========================================================" - echo "" - echo "$PR_TEST_RESULT" - ) - PR_BUILD_RESULT_LOG_TEMP=$(echo "$PR_BUILD_FINAL_RESULT" | sed 's/$/%0A/') - PR_BUILD_RESULT_LOG=$(echo $PR_BUILD_RESULT_LOG_TEMP) - echo "::warning::$PR_BUILD_RESULT_LOG" - PR_BUILD_SUCCESS_COUNT=$(grep -o -i "\[INFO\] BUILD SUCCESS" mvn-build.log | wc -l) - if [ "$PR_BUILD_SUCCESS_COUNT" != "1" ]; then - echo "PR BUILD not successfull. Aborting." - echo "::error::PR BUILD not successfull. Check artifacts for logs." - exit 1 - fi - - if [ -s dependency_updates.diff ] - then - echo "" - echo 'Commit Changes' - echo "==========================================================" - git config --global user.email ${{ env.GIT_EMAIL }} - git config --global user.name ${{ env.GIT_USERNAME }} - git commit -a -m 'Bump dependencies from '${{ env.DEPENDENCY_UPGRADE_BRANCH_NAME }} - git remote rm origin - git remote add origin 'https://'${{ secrets.PAT }}'@github.com/'${{ env.PRODUCT_REPOSITORY_FORKED }} - - echo "" - echo 'Push Changes' - echo "==========================================================" - git push -u origin ${{ env.DEPENDENCY_UPGRADE_BRANCH_NAME }} - - echo "" - echo 'Send Pull Request' - echo "==========================================================" - - TITLE="[7.x.x] Bump Dependencies #"${{ env.BUILD_NUMBER }} - RESPONSE=$(curl -s -w "%{http_code}" -k -X \ - POST https://api.github.com/repos/${{ env.PRODUCT_REPOSITORY_PUBLIC }}/pulls \ - -H "Authorization: Bearer "${{ secrets.PAT }}"" \ - -H "Content-Type: application/json" \ - -d '{ "title": "'"${TITLE}"'","body": "Bumps dependencies for product-is. Link : https://github.com/wso2/product-is/actions/runs/${{github.run_id}}","head": "'"${{ env.GIT_USERNAME }}:${{ env.DEPENDENCY_UPGRADE_BRANCH_NAME }}"'","base":"'"${{ env.TARGET_BRANCH_NAME }}"'"}') - RESPONSE_BODY=${RESPONSE::-3} - STATUS=$(printf "%s" "$RESPONSE" | tail -c 3) - if [[ $STATUS == "201" ]]; then - echo "PR=$(echo $RESPONSE_BODY | jq -r '.html_url')" >> $GITHUB_ENV - fi - else - echo "" - echo "There are no dependency updates available" - echo "==========================================================" - exit 0 - fi - - name: Archive dependency diff file - if: always() - uses: actions/upload-artifact@v4 - with: - name: dependency-updates-diff - path: | - ${{steps.builder_step.outputs.REPO_NAME}}/dependency_updates.diff - - name: Archive maven-build-log file - if: always() - uses: actions/upload-artifact@v4 - with: - name: mvn-build.log - path: | - ${{steps.builder_step.outputs.REPO_NAME}}/mvn-build.log - if-no-files-found: warn diff --git a/.github/workflows/dependency-updater.yml b/.github/workflows/dependency-updater.yml index 284ac65fe0a..a76d7e2e3fa 100644 --- a/.github/workflows/dependency-updater.yml +++ b/.github/workflows/dependency-updater.yml @@ -26,9 +26,9 @@ jobs: JAVA_TOOL_OPTIONS: "-Djdk.util.zip.disableZip64ExtraFieldValidation=true -Djdk.nio.zipfs.allowDotZipEntry=true" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Adopt JDK 11 - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: java-version: "11" distribution: "adopt" @@ -37,7 +37,7 @@ jobs: echo $JAVA_HOME - name: Cache local Maven repository id: cache-maven-m2 - uses: actions/cache@v2 + uses: actions/cache@v4 env: cache-name: cache-m2 with: diff --git a/.github/workflows/fapi-oidc-conformance-test.yml b/.github/workflows/fapi-oidc-conformance-test.yml index db67cf415cd..42a499256ae 100644 --- a/.github/workflows/fapi-oidc-conformance-test.yml +++ b/.github/workflows/fapi-oidc-conformance-test.yml @@ -32,12 +32,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: path: './product-is' - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: java-version: 11.0.18+10 @@ -189,7 +189,7 @@ jobs: python3 ./configure_is_fapi.py ../../$PRODUCT_IS_ZIP - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: 17 distribution: temurin diff --git a/.github/workflows/fork-branch-deleter.yml b/.github/workflows/fork-branch-deleter.yml index a6b1e897c69..d6dbcb6c902 100644 --- a/.github/workflows/fork-branch-deleter.yml +++ b/.github/workflows/fork-branch-deleter.yml @@ -13,7 +13,7 @@ jobs: steps: # Check out the product-is fork of 'jenkins-is-staging' user - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: repository: ${{ github.event.pull_request.head.repo.full_name }} token: ${{ secrets.PAT }} diff --git a/.github/workflows/fossa-scanner.yaml b/.github/workflows/fossa-scanner.yaml index f735365f733..b735f753f62 100644 --- a/.github/workflows/fossa-scanner.yaml +++ b/.github/workflows/fossa-scanner.yaml @@ -8,7 +8,7 @@ jobs: fossa-scan: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: fossas/fossa-action@main with: api-key: ${{secrets.FOSSAAPIKEY}} diff --git a/.github/workflows/migration-automation.yml b/.github/workflows/migration-automation.yml index eead65a5089..b4d9167c57d 100644 --- a/.github/workflows/migration-automation.yml +++ b/.github/workflows/migration-automation.yml @@ -53,7 +53,7 @@ jobs: runs-on: ${{ github.event.inputs.os }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Docker environment run: | # Get the ID of the workflow from the GitHub API using curl and jq @@ -136,7 +136,7 @@ jobs: runs-on: ${{ github.event.inputs.os }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Execute Migration Automation Script Ubuntu run: | chmod +x ${{ github.workspace }}/.github/migration-tester/migration-automation/ubuntu-os/migration-script-ubuntu.sh @@ -172,7 +172,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Create MS SQL Database run: | @@ -215,7 +215,7 @@ jobs: runs-on: ${{ github.event.inputs.os }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Execute Migration Automation Script Mac run: | @@ -240,7 +240,7 @@ jobs: if: ${{ github.event.inputs.database == 'postgres' && github.event.inputs.os == 'macos-latest' }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up PostgreSQL env: PGDATA: /usr/local/var/postgres @@ -287,7 +287,7 @@ jobs: runs-on: ${{ github.event.inputs.os }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - uses: potatoqualitee/mssqlsuite@v1.7 with: @@ -344,7 +344,7 @@ jobs: runs-on: ${{ github.event.inputs.os }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Download Artifacts uses: actions/download-artifact@v2 if: always() diff --git a/.github/workflows/oidc-conformance-test.yml b/.github/workflows/oidc-conformance-test.yml index e6391ced686..99b593f09ae 100644 --- a/.github/workflows/oidc-conformance-test.yml +++ b/.github/workflows/oidc-conformance-test.yml @@ -36,12 +36,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: path: './product-is' - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: java-version: 11.0.18+10 @@ -142,7 +142,7 @@ jobs: python3 ./configure_is.py ../../$PRODUCT_IS_ZIP $ROOT_DIR $ROOT_DIR/jacoco.exec - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: 17 distribution: temurin diff --git a/.github/workflows/pr-builder-test-JDK11-7.yml b/.github/workflows/pr-builder-test-JDK11-7.yml deleted file mode 100644 index 75aab52ac5c..00000000000 --- a/.github/workflows/pr-builder-test-JDK11-7.yml +++ /dev/null @@ -1,130 +0,0 @@ -name: "[Deprecated] pr-builder-test 7.x.x" - -on: - workflow_dispatch: - inputs: - pr: - description: "Enter PR link (ex: https://github.com/wso2-extensions/identity-inbound-auth-oauth/pull/1481)" - default: - required: true - jdk: - description: "Enter Java version (ex: 8,11)" - default: - required: true - -env: - MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 - - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Print Input - run: echo Running the PR builder for PR - ${{ github.event.inputs.pr }} - - name: Comment build info - run: | - owner=$(echo '${{github.event.inputs.pr}}' | cut -d "/" -f 4) - repo=$(echo '${{github.event.inputs.pr}}' | cut -d "/" -f 5) - pr_number=$(echo '${{github.event.inputs.pr}}' | cut -d "/" -f 7) - curl -X POST https://api.github.com/repos/$owner/$repo/issues/$pr_number/comments -H 'Authorization: token ${{secrets.PR_BUILDER_COMMENT}}' -d '{"body":"PR builder [7.x.x] started \nLink: https://github.com/wso2/product-is/actions/runs/${{github.run_id}}"}' - - uses: actions/checkout@v2 - - name: Set up Adopt JDK 8 - uses: actions/setup-java@v2 - with: - java-version: "8" - distribution: "adopt" - - name: Echo java 8 home - run: | - echo "J8HOME=$JAVA_HOME" >> ${GITHUB_ENV} - id: java-8-setup - - name: Set up Adopt JDK 11 - uses: actions/setup-java@v2 - with: - java-version: "11" - distribution: "adopt" - - name: Echo java 11 home - run: | - echo "J11HOME=$JAVA_HOME" >> ${GITHUB_ENV} - - name: Build init - run: | - echo "CURRENT_MONTH=$(date +%Y-%m)" >> ${GITHUB_ENV} - - name: Cache maven packages - id: cache-maven-m2 - uses: actions/cache@v2 - with: - path: | - ~/.m2 - !~/.m2/repository/org/wso2/is/wso2is - key: ${{ runner.os }}-pr-builder-${{ env.CURRENT_MONTH }} - - name: Setup pnpm - id: setup-pnpm - uses: pnpm/action-setup@v2.1.0 - with: - version: latest - run_install: false - - name: Run PR builder - id: builder_step - env: - PR_LINK: ${{github.event.inputs.pr}} - JDK_VERSION: ${{github.event.inputs.jdk}} - JAVA_8_HOME: ${{env.J8HOME}} - JAVA_11_HOME: ${{env.J11HOME}} - run: | - wget https://raw.githubusercontent.com/wso2/product-is/master/.github/scripts/pr-builder-7.sh - bash pr-builder-7.sh - - name: Archive PR diff file - if: always() - uses: actions/upload-artifact@v4 - with: - name: repo-pr-diff - path: | - ${{steps.builder_step.outputs.REPO_NAME}}/diff.diff - if-no-files-found: warn - - name: Archive repo mvn build log - if: always() && steps.builder_step.outputs.REPO_NAME != 'product-is' - uses: actions/upload-artifact@v4 - with: - name: repo-mvn-build-log - path: | - ${{steps.builder_step.outputs.REPO_NAME}}/mvn-build.log - if-no-files-found: warn - - name: Archive repo surefire reports - if: always() && steps.builder_step.outputs.REPO_NAME != 'product-is' - uses: actions/upload-artifact@v4 - with: - name: repo-surefire-report - path: | - ${{steps.builder_step.outputs.REPO_NAME}}/**/surefire-reports - if-no-files-found: warn - - name: Archive product-is mvn build log - if: always() - uses: actions/upload-artifact@v4 - with: - name: product-is-mvn-build-log - path: | - product-is/mvn-build.log - if-no-files-found: warn - - name: Archive product-is surefire reports - if: always() - uses: actions/upload-artifact@v4 - with: - name: product-is-surefire-report - path: | - product-is/**/surefire-reports - if-no-files-found: warn - - name: Comment build status - if: always() - run: | - owner=$(echo '${{github.event.inputs.pr}}' | cut -d "/" -f 4) - repo=$(echo '${{github.event.inputs.pr}}' | cut -d "/" -f 5) - pr_number=$(echo '${{github.event.inputs.pr}}' | cut -d "/" -f 7) - curl -X POST https://api.github.com/repos/$owner/$repo/issues/$pr_number/comments -H 'Authorization: token ${{secrets.PR_BUILDER_COMMENT}}' -d '{"body":"PR builder [7.x.x] completed \nLink: https://github.com/wso2/product-is/actions/runs/${{github.run_id}} \nStatus: **${{job.status}}**"}' - - name: Approve PR - if: success() - run: | - owner=$(echo '${{github.event.inputs.pr}}' | cut -d "/" -f 4) - repo=$(echo '${{github.event.inputs.pr}}' | cut -d "/" -f 5) - pr_number=$(echo '${{github.event.inputs.pr}}' | cut -d "/" -f 7) - curl -X POST https://api.github.com/repos/$owner/$repo/pulls/$pr_number/reviews -H 'Authorization:token ${{secrets.PR_BUILDER_COMMENT}}' -d '{"body":"Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/${{github.run_id}}","event":"APPROVE"}' diff --git a/.github/workflows/pr-builder-test-JDK11.yml b/.github/workflows/pr-builder-test-JDK11.yml index 8dba76647fc..b043b577461 100644 --- a/.github/workflows/pr-builder-test-JDK11.yml +++ b/.github/workflows/pr-builder-test-JDK11.yml @@ -32,9 +32,9 @@ jobs: repo=$(echo '${{github.event.inputs.pr}}' | cut -d "/" -f 5) pr_number=$(echo '${{github.event.inputs.pr}}' | cut -d "/" -f 7) curl -X POST https://api.github.com/repos/$owner/$repo/issues/$pr_number/comments -H 'Authorization: token ${{secrets.PR_BUILDER_COMMENT}}' -d '{"body":"PR builder started \nLink: https://github.com/wso2/product-is/actions/runs/${{github.run_id}}"}' - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Adopt JDK 8 - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: java-version: "8" distribution: "adopt" @@ -43,7 +43,7 @@ jobs: echo "J8HOME=$JAVA_HOME" >> ${GITHUB_ENV} id: java-8-setup - name: Set up Adopt JDK 11 - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: java-version: "11" distribution: "adopt" @@ -55,7 +55,7 @@ jobs: echo "CURRENT_MONTH=$(date +%Y-%m)" >> ${GITHUB_ENV} - name: Cache maven packages id: cache-maven-m2 - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | ~/.m2 @@ -63,7 +63,7 @@ jobs: key: ${{ runner.os }}-pr-builder-${{ env.CURRENT_MONTH }} - name: Setup pnpm id: setup-pnpm - uses: pnpm/action-setup@v2.1.0 + uses: pnpm/action-setup@v4 with: version: latest run_install: false diff --git a/.github/workflows/product-is-builder-jdk17.yml b/.github/workflows/product-is-builder-jdk17.yml index c94a139c99d..5ab1355da9d 100644 --- a/.github/workflows/product-is-builder-jdk17.yml +++ b/.github/workflows/product-is-builder-jdk17.yml @@ -20,9 +20,9 @@ jobs: steps: - name: Checkout repository code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Adopt JDK 11 - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: java-version: "11" distribution: "adopt" @@ -30,7 +30,7 @@ jobs: run: | mvn clean install --batch-mode -Dmaven.test.skip=true | tee mvn-build.log - name: Set up Adopt JDK 17 - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: java-version: "17" distribution: "adopt" diff --git a/.github/workflows/product-is-builder-jdk21.yml b/.github/workflows/product-is-builder-jdk21.yml index 632f0b71100..772a3331918 100644 --- a/.github/workflows/product-is-builder-jdk21.yml +++ b/.github/workflows/product-is-builder-jdk21.yml @@ -20,9 +20,9 @@ jobs: steps: - name: Checkout repository code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Adopt JDK 11 - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: java-version: "11" distribution: "adopt" @@ -30,7 +30,7 @@ jobs: run: | mvn clean install --batch-mode -Dmaven.test.skip=true | tee mvn-build.log - name: Set up Adopt JDK 21 - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: java-version: "21" distribution: "adopt"