From e43082df0ad013554e1d03e03b15fe1b6b92629f Mon Sep 17 00:00:00 2001 From: Ben Martin Date: Mon, 20 Jan 2025 23:58:18 +0000 Subject: [PATCH 1/5] feat: add CI build and release workflows This commit introduces two new GitHub Actions workflows: - `build.yaml`: Configures a workflow for building the project on pushes to the `master` branch and on pull requests. - `release.yaml`: Configures a workflow for releasing the project on tagged pushes, specifically for tags starting with 'v'. It builds the project, releases it using Gradle, and uploads the generated APK artifacts. --- .github/workflows/build.yaml | 24 ++++++++++++++++++++++++ .github/workflows/release.yaml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 .github/workflows/build.yaml create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..7802aec --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,24 @@ +name: Build + +on: + push: + branches: + - master + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '11' + + - name: Build with Gradle + run: ./gradlew composeApp:buildDebug diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..a324ded --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,32 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '11' + + - name: Build with Gradle + run: ./gradlew composeApp:buildDebug + + - name: Gradle Release + run: ./gradlew composeApp:debug + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: app + path: composeApp/build/outputs/apk/debug/*.apk -- 2.47.2 From 25dd3ae7cb386c7d6515228fb2c32f681869f01d Mon Sep 17 00:00:00 2001 From: Ben Martin Date: Tue, 21 Jan 2025 00:29:24 +0000 Subject: [PATCH 2/5] feat: update JDK version to 17 in CI workflows This commit updates the JDK version used in the CI build and release workflows from 11 to 17. This change affects the `build.yaml` and `release.yaml` files. --- .github/workflows/build.yaml | 4 ++-- .github/workflows/release.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7802aec..e8a944d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -14,11 +14,11 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v2 with: distribution: 'adopt' - java-version: '11' + java-version: '17' - name: Build with Gradle run: ./gradlew composeApp:buildDebug diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a324ded..9452827 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -13,11 +13,11 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v2 with: distribution: 'adopt' - java-version: '11' + java-version: '17' - name: Build with Gradle run: ./gradlew composeApp:buildDebug -- 2.47.2 From b161684cae78b1a5a59da37f90f7abff06c545c4 Mon Sep 17 00:00:00 2001 From: Ben Martin Date: Tue, 21 Jan 2025 00:35:49 +0000 Subject: [PATCH 3/5] feat: update JDK and add Android SDK setup in CI workflows This commit updates the CI build and release workflows by making the following changes: - Updates the Java setup action to version 3. - Changes the JDK distribution to 'temurin'. - Adds a step to set up the Android SDK using `android-actions/setup-android@v3`. These changes apply to both `build.yaml` and `release.yaml` files. --- .github/workflows/build.yaml | 7 +++++-- .github/workflows/release.yaml | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e8a944d..8bc89e2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,10 +15,13 @@ jobs: uses: actions/checkout@v2 - name: Set up JDK 17 - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: - distribution: 'adopt' java-version: '17' + distribution: 'temurin' + + - name: Setup Android SDK + uses: android-actions/setup-android@v3 - name: Build with Gradle run: ./gradlew composeApp:buildDebug diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9452827..88ce265 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,10 +14,13 @@ jobs: uses: actions/checkout@v2 - name: Set up JDK 17 - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: - distribution: 'adopt' java-version: '17' + distribution: 'temurin' + + - name: Setup Android SDK + uses: android-actions/setup-android@v3 - name: Build with Gradle run: ./gradlew composeApp:buildDebug -- 2.47.2 From ab14b90143b71a8294d1289f920cf34ef2e0ac8a Mon Sep 17 00:00:00 2001 From: Ben Martin Date: Tue, 21 Jan 2025 00:46:43 +0000 Subject: [PATCH 4/5] feat: add `--no-daemon` flag to Gradle build commands in CI workflows This commit updates the CI build and release workflows by adding the `--no-daemon` flag to the Gradle build commands. This change affects the `build.yaml` and `release.yaml` files. - The `--no-daemon` flag is now included when running `./gradlew composeApp:buildDebug` and `./gradlew composeApp:debug`. --- .github/workflows/build.yaml | 2 +- .github/workflows/release.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8bc89e2..392b869 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -24,4 +24,4 @@ jobs: uses: android-actions/setup-android@v3 - name: Build with Gradle - run: ./gradlew composeApp:buildDebug + run: ./gradlew composeApp:buildDebug --no-daemon diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 88ce265..f0eb943 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -23,10 +23,10 @@ jobs: uses: android-actions/setup-android@v3 - name: Build with Gradle - run: ./gradlew composeApp:buildDebug + run: ./gradlew composeApp:buildDebug --no-daemon - name: Gradle Release - run: ./gradlew composeApp:debug + run: ./gradlew composeApp:debug --no-daemon - name: Upload artifacts uses: actions/upload-artifact@v4 -- 2.47.2 From c55308f08016a70b9cd63ce07e9b336f187d9e97 Mon Sep 17 00:00:00 2001 From: Ben Martin Date: Tue, 21 Jan 2025 00:54:15 +0000 Subject: [PATCH 5/5] feat: add Gradle caching in CI workflows This commit updates the CI build and release workflows to enable Gradle caching. This change adds `cache: gradle` to the Java setup action. These changes apply to both `build.yaml` and `release.yaml` files. --- .github/workflows/build.yaml | 1 + .github/workflows/release.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 392b869..e82b904 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -19,6 +19,7 @@ jobs: with: java-version: '17' distribution: 'temurin' + cache: gradle - name: Setup Android SDK uses: android-actions/setup-android@v3 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f0eb943..042d3ad 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -18,6 +18,7 @@ jobs: with: java-version: '17' distribution: 'temurin' + cache: gradle - name: Setup Android SDK uses: android-actions/setup-android@v3 -- 2.47.2