Skip to content

Commit

Permalink
Fix cicd to checkout codegen tool frame work release
Browse files Browse the repository at this point in the history
  • Loading branch information
ThishaniLucas committed Nov 17, 2023
1 parent a882746 commit e3ae700
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -54,27 +57,27 @@ 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
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_STAGE_ACCESS_TOKEN }}

- 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
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_DEV_ACCESS_TOKEN }}

- 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 }}
Expand Down Expand Up @@ -113,22 +116,23 @@ 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,/<version>${CURRENT_VERSION}<\/version>/s//<version>${NEW_VERSION}<\/version>/" pom.xml
sed -i "0,/<version>${CURRENT_VERSION}<\/version>/s//<version>${NEW_VERSION}<\/version>/" ballerina/pom.xml
sed -i "0,/<version>${CURRENT_VERSION}<\/version>/s//<version>${NEW_VERSION}<\/version>/" native/fhir-to-bal-lib/pom.xml
sed -i "0,/<version>${CURRENT_VERSION}<\/version>/s//<version>${NEW_VERSION}<\/version>/" native/fhir-to-bal-template/pom.xml
sed -i "0,/<version>${CURRENT_VERSION}<\/version>/s//<version>${NEW_VERSION}<\/version>/" native/health-cli/pom.xml
sed -i "0,/<version>${CURRENT_VERSION}<\/version>/s//<version>${NEW_VERSION}<\/version>/" fhir-tools/pom.xml
sed -i "0,/<version>${CURRENT_VERSION}<\/version>/s//<version>${NEW_VERSION}<\/version>/" fhir-tools/ballerina/pom.xml
sed -i "0,/<version>${CURRENT_VERSION}<\/version>/s//<version>${NEW_VERSION}<\/version>/" fhir-tools/native/fhir-to-bal-lib/pom.xml
sed -i "0,/<version>${CURRENT_VERSION}<\/version>/s//<version>${NEW_VERSION}<\/version>/" fhir-tools/native/fhir-to-bal-template/pom.xml
sed -i "0,/<version>${CURRENT_VERSION}<\/version>/s//<version>${NEW_VERSION}<\/version>/" fhir-tools/native/health-cli/pom.xml
- name: Commit changes and make a PR
if: ${{ inputs.bal_central_environment == 'PROD' }}
run: |
# 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 }}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -47,5 +50,5 @@ jobs:
- name: Run maven build
run: |
mvn clean install
mvn clean install -f fhir-tools/pom.xml

0 comments on commit e3ae700

Please sign in to comment.