@@ -32,19 +32,18 @@ jobs:
3232 uses : actions/checkout@v3
3333 with :
3434 fetch-depth : 0
35+ ref : ${{ inputs.branch }}
3536 - name : Prepare to build
3637 run : |
3738 echo ADDITIONAL_GRADLE_OPTS= >> $GITHUB_ENV
3839 echo SAVE_CLI_GRADLE_OPTS= >> $GITHUB_ENV
40+ echo SAVE_AGENT_GRADLE_OPTS = >> $GITHUB_ENV
41+ echo SAVE_DEMO_AGENT_GRADLE_OPTS = >> $GITHUB_ENV
3942 echo GRADLE_TASKS=:${{ inputs.module}}:bootBuildImage >> $GITHUB_ENV
4043 - name : Override gradle command for frontend
41- if : inputs.module == 'save-frontend'
44+ if : inputs.module == 'save-frontend' || inputs.module == 'save-cosv-frontend'
4245 run : |
4346 echo GRADLE_TASKS=:${{ inputs.module}}:buildImage >> $GITHUB_ENV
44- - name : Prepare to build from branch
45- if : inputs.branch
46- run : |
47- git checkout origin/${{ inputs.branch }}
4847 - name : Override dockerTag
4948 if : inputs.override-docker-tag
5049 run : |
@@ -63,24 +62,42 @@ jobs:
6362 with :
6463 java-version : 17
6564 distribution : temurin
66- - name : Install system packages
67- if : inputs.module == 'save-backend' || inputs.module == 'save-sandbox' || inputs.module == 'save-demo'
68- # libcurl is needed for ktor-client-curl
69- run : sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev
65+
7066 - name : Download save-cli
7167 if : ${{ endsWith(inputs.save-cli-version, '-SNAPSHOT') }}
7268 uses : actions/download-artifact@v3
7369 with :
7470 name : save-cli
75- path : ${{ github.workspace }}/save
76- - name : Override saveCliVersion and saveCliPath in Gradle
71+ path : ${{ github.workspace }}/save-cli
72+ - name : Set saveCliVersion and saveCliPath in Gradle
7773 if : ${{ endsWith(inputs.save-cli-version, '-SNAPSHOT') }}
7874 run : |
79- echo SAVE_CLI_GRADLE_OPTS=-PsaveCliVersion=${{ inputs.save-cli-version }} -PsaveCliPath=${{ github.workspace }}/save >> $GITHUB_ENV
75+ echo SAVE_CLI_GRADLE_OPTS=-PsaveCliVersion=${{ inputs.save-cli-version }} -PsaveCliPath=${{ github.workspace }}/save-cli >> $GITHUB_ENV
76+
77+ - name : Download save-agent
78+ if : inputs.module == 'save-backend' || inputs.module == 'save-sandbox'
79+ uses : actions/download-artifact@v3
80+ with :
81+ name : save-agent
82+ path : ${{ github.workspace }}/save-agent
83+ - name : Set saveAgentPath in Gradle
84+ if : inputs.module == 'save-backend' || inputs.module == 'save-sandbox'
85+ run : |
86+ echo SAVE_AGENT_GRADLE_OPTS=-PsaveAgentPath=${{ github.workspace }}/save-agent >> $GITHUB_ENV
87+
88+ - name : Download save-demo-agent
89+ if : inputs.module == 'save-demo'
90+ uses : actions/download-artifact@v3
91+ with :
92+ name : save-demo-agent
93+ path : ${{ github.workspace }}/save-demo-agent
94+ - name : Set saveDemoAgentPath in Gradle
95+ if : inputs.module == 'save-demo'
96+ run : |
97+ echo SAVE_DEMO_AGENT_GRADLE_OPTS=-PsaveDemoAgentPath=${{ github.workspace }}/save-demo-agent >> $GITHUB_ENV
98+
8099 - name : Build image for ${{ inputs.module }}
81100 uses : gradle/gradle-build-action@v2
82- env :
83- DOWNLOAD_SAVE_CLI_DEPENDENCY : true
84101 with :
85102 gradle-version : wrapper
86103 arguments : |
@@ -91,21 +108,9 @@ jobs:
91108 -PgprUser=${{ github.actor }}
92109 -PgprKey=${{ secrets.GITHUB_TOKEN }}
93110 ${{ env.SAVE_CLI_GRADLE_OPTS }}
111+ ${{ env.SAVE_AGENT_GRADLE_OPTS }}
112+ ${{ env.SAVE_DEMO_AGENT_GRADLE_OPTS }}
94113 ${{ env.ADDITIONAL_GRADLE_OPTS }}
95- - name : Upload save-agent-distribution.jar
96- if : inputs.module == 'save-backend'
97- uses : actions/upload-artifact@v3
98- with :
99- name : save-agent-distribution
100- path : ' save-agent/build/libs/save-agent-*-distribution.jar'
101- retention-days : 5
102- - name : Upload save-demo-agent-distribution.jar
103- if : inputs.module == 'save-demo'
104- uses : actions/upload-artifact@v3
105- with :
106- name : save-demo-agent-distribution
107- path : ' save-demo-agent/build/libs/save-demo-agent-*-distribution.jar'
108- retention-days : 5
109114 - name : Upload gradle reports
110115 if : ${{ always() }}
111116 uses : actions/upload-artifact@v3
0 commit comments