[CTM-1126] Update workflows to build, archive & download maven repo #55
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: | |
workflow_call: | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- 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: Write version to file | |
run: | | |
echo "${{ steps.decide_build_number.outputs.marketing_build_version }}" > version.txt | |
- name: Upload version (to be used in release.yml) | |
uses: actions/upload-artifact@v3 | |
with: | |
name: version | |
path: version.txt | |
- 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 | |
with: | |
name: 'cumulocity-clients-kotlin-aar' | |
path: 'build/outputs/aar/*.aar' | |
- name: Invoke Gradle for jar | |
run: | | |
chmod +x gradlew | |
./gradlew --console plain -b build-jar.gradle clean build publish -x test --debug | |
- name: Archive jar file | |
uses: actions/upload-artifact@v3 | |
with: | |
name: 'cumulocity-clients-kotlin-jar' | |
path: 'build/libs/*.jar' | |
- name: Archive maven repo files | |
uses: actions/upload-artifact@v3 | |
with: | |
name: 'cumulocity-clients-kotlin-maven' | |
path: 'build/mavenRepo/*' |