Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cicd to checkout codegen tool framework release #56

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Loading