[CTM-1117] create build.yml to build jar & aar file #20
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
workflow_dispatch: | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '20' | |
- name: Decide Build Number | |
id: decide_build_number | |
run: | | |
VERSION=$(awk -F "'" '/archiveVersion =/{print $2}' build-jar.gradle) | |
echo "Found version: $VERSION" | |
echo "marketing_build_version=$VERSION" >> $GITHUB_OUTPUT | |
- name: Invoke Gradle for aar | |
run: | | |
chmod +x gradlew | |
./gradlew --console plain clean build assemble -x test | |
- name: Archive aar file | |
uses: actions/upload-artifact@v3 | |
env: | |
MARKETING_VERSION: ${{ steps.decide_build_number.outputs.marketing_build_version }} | |
with: | |
name: 'cumulocity-clients-kotlin-${{ env.MARKETING_VERSION }}' | |
path: 'build/outputs/aar/*.aar' | |
- name: Invoke Gradle for jar | |
run: | | |
chmod +x gradlew | |
./gradlew --console plain -b build-jar.gradle clean build -x test | |
- name: Archive jar file | |
uses: actions/upload-artifact@v3 | |
env: | |
MARKETING_VERSION: ${{ steps.decide_build_number.outputs.marketing_build_version }} | |
with: | |
name: 'cumulocity-clients-kotlin-${{ env.MARKETING_VERSION }}' | |
path: 'build/libs/*.jar' |