From e3ae700afbdda6a130c78ae0a6aa1fe1812ee63d Mon Sep 17 00:00:00 2001 From: ThishaniLucas Date: Fri, 17 Nov 2023 11:56:33 +0530 Subject: [PATCH] Fix cicd to checkout codegen tool frame work release --- .github/workflows/cd.yml | 30 +++++++++++++++++------------- .github/workflows/ci.yml | 5 ++++- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index dc34463..bc197f2 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -19,11 +19,14 @@ jobs: JAVA_OPTS: -Xmx4G steps: - uses: actions/checkout@v3 + with: + path: './fhir-tools' - name: Checkout codegen framework uses: actions/checkout@v3 with: repository: wso2/open-healthcare-codegen-tool-framework + ref: v1.0.0 path: './open-healthcare-codegen-tool-framework' - name: Setup Java and Maven @@ -54,11 +57,11 @@ jobs: - name: Run maven build run: | - mvn clean install + mvn clean install -f fhir-tools/pom.xml - name: Push to Staging if: inputs.bal_central_environment == 'STAGE' - working-directory: ballerina/target/health-tool-ballerina + working-directory: fhir-tools/ballerina/target/health-tool-ballerina run: bal push env: BALLERINA_STAGE_CENTRAL: true @@ -66,7 +69,7 @@ jobs: - name: Push to Dev if: inputs.bal_central_environment == 'DEV' - working-directory: ballerina/target/health-tool-ballerina + working-directory: fhir-tools/ballerina/target/health-tool-ballerina run: bal push env: BALLERINA_DEV_CENTRAL: true @@ -74,7 +77,7 @@ jobs: - name: Push to Prod if: inputs.bal_central_environment == 'PROD' - working-directory: ballerina/target/health-tool-ballerina + working-directory: fhir-tools/ballerina/target/health-tool-ballerina run: bal push env: BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_ACCESS_TOKEN }} @@ -113,11 +116,11 @@ jobs: echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_OUTPUT echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_OUTPUT #Bump the versions in each pom file - sed -i "0,/${CURRENT_VERSION}<\/version>/s//${NEW_VERSION}<\/version>/" pom.xml - sed -i "0,/${CURRENT_VERSION}<\/version>/s//${NEW_VERSION}<\/version>/" ballerina/pom.xml - sed -i "0,/${CURRENT_VERSION}<\/version>/s//${NEW_VERSION}<\/version>/" native/fhir-to-bal-lib/pom.xml - sed -i "0,/${CURRENT_VERSION}<\/version>/s//${NEW_VERSION}<\/version>/" native/fhir-to-bal-template/pom.xml - sed -i "0,/${CURRENT_VERSION}<\/version>/s//${NEW_VERSION}<\/version>/" native/health-cli/pom.xml + sed -i "0,/${CURRENT_VERSION}<\/version>/s//${NEW_VERSION}<\/version>/" fhir-tools/pom.xml + sed -i "0,/${CURRENT_VERSION}<\/version>/s//${NEW_VERSION}<\/version>/" fhir-tools/ballerina/pom.xml + sed -i "0,/${CURRENT_VERSION}<\/version>/s//${NEW_VERSION}<\/version>/" fhir-tools/native/fhir-to-bal-lib/pom.xml + sed -i "0,/${CURRENT_VERSION}<\/version>/s//${NEW_VERSION}<\/version>/" fhir-tools/native/fhir-to-bal-template/pom.xml + sed -i "0,/${CURRENT_VERSION}<\/version>/s//${NEW_VERSION}<\/version>/" fhir-tools/native/health-cli/pom.xml - name: Commit changes and make a PR if: ${{ inputs.bal_central_environment == 'PROD' }} @@ -125,10 +128,11 @@ jobs: # Commit changes git config --global user.name ${{ secrets.BALLERINA_BOT_USERNAME }} git config --global user.email ${{ secrets.BALLERINA_BOT_EMAIL }} - git add fhirr4/pom.xml - git add fhirr4/ballerina/pom.xml - git add fhirr4/compiler-plugin/pom.xml - git add fhirr4/native/pom.xml + git add fhir-tools/pom.xml + git add fhir-tools/ballerina/pom.xml + git add fhir-tools/native/fhir-to-bal-lib/pom.xml + git add fhir-tools/native/fhir-to-bal-template/pom.xml + git add fhir-tools/native/health-cli/pom.xml git commit -m "[Release Health Tool ${{ steps.increment_patch_version.outputs.CURRENT_VERSION }}] Prepare for next dev cycle" git push origin ${{ steps.publish_release.outputs.BRANCH_NAME }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f40133..bb704a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,11 +12,14 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + with: + path: './fhir-tools' - name: Checkout codegen framework uses: actions/checkout@v3 with: repository: wso2/open-healthcare-codegen-tool-framework + ref: v1.0.0 path: './open-healthcare-codegen-tool-framework' - name: Setup Maven @@ -47,5 +50,5 @@ jobs: - name: Run maven build run: | - mvn clean install + mvn clean install -f fhir-tools/pom.xml \ No newline at end of file