Skip to content

Commit 9737c2f

Browse files
authored
Chore: Update workflows (#28)
- Build step now runs on multiple different OS's - Cache the macos `konan` files - Move gradle wrapper check to inside the workflows - Move Documentation job to after publishing
1 parent d70e849 commit 9737c2f

File tree

7 files changed

+111
-161
lines changed

7 files changed

+111
-161
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,8 @@ jobs:
3636
java-version: 17
3737
distribution: adopt
3838

39-
# AGP 8.2 requires 34.0.0-rc3 - see https://issuetracker.google.com/issues/236167971#comment36
40-
# and https://github.com/actions/runner-images/issues/7506#issuecomment-1533097084
41-
# TODO: Remove when AGP updates Build Tools to 34.0.0 and pre-installed in the runner
42-
- name: Install Android Build Tools 34.0.0-rc3
43-
run: echo "y" | /usr/local/lib/android/sdk/cmdline-tools/latest/bin/sdkmanager "build-tools;34.0.0-rc3"
44-
shell: bash
45-
46-
- uses: actions/cache@v3
39+
- name: Cache Gradle
40+
uses: actions/cache@v3
4741
with:
4842
path: |
4943
~/.gradle/caches
@@ -52,14 +46,26 @@ jobs:
5246
restore-keys: |
5347
${{ runner.os }}-gradle-
5448
49+
- name: Gradle Wrapper Validation
50+
uses: gradle/wrapper-validation-action@v1
51+
5552
- name: Lint
5653
uses: gradle/gradle-build-action@v2
5754
with:
5855
arguments: lint --scan
5956

6057
build:
61-
name: "Build"
62-
runs-on: ubuntu-latest
58+
strategy:
59+
matrix:
60+
config: [
61+
{ target: "android", os: "ubuntu-latest", tasks: ":demo:kmm:androidApp:assembleRelease", continueOnError: false },
62+
{ target: "osx", os: "macos-latest", tasks: ":demo:kmm:desktopApp:packageDistributionForCurrentOS", continueOnError: false },
63+
{ target: "windows", os: "windows-latest", tasks: ":demo:kmm:desktopApp:packageDistributionForCurrentOS", continueOnError: true },
64+
{ target: "linux", os: "ubuntu-latest", tasks: ":demo:kmm:desktopApp:packageDistributionForCurrentOS", continueOnError: false }
65+
]
66+
runs-on: ${{ matrix.config.os }}
67+
name: Build ${{ matrix.config.target }}
68+
needs: verify
6369
steps:
6470
- name: Checkout
6571
uses: actions/checkout@v3
@@ -70,14 +76,8 @@ jobs:
7076
java-version: 17
7177
distribution: adopt
7278

73-
# AGP 8.2 requires 34.0.0-rc3 - see https://issuetracker.google.com/issues/236167971#comment36
74-
# and https://github.com/actions/runner-images/issues/7506#issuecomment-1533097084
75-
# TODO: Remove when AGP updates Build Tools to 34.0.0 and pre-installed in the runner
76-
- name: Install Android Build Tools 34.0.0-rc3
77-
run: echo "y" | /usr/local/lib/android/sdk/cmdline-tools/latest/bin/sdkmanager "build-tools;34.0.0-rc3"
78-
shell: bash
79-
80-
- uses: actions/cache@v3
79+
- name: Cache Gradle
80+
uses: actions/cache@v3
8181
with:
8282
path: |
8383
~/.gradle/caches
@@ -86,36 +86,20 @@ jobs:
8686
restore-keys: |
8787
${{ runner.os }}-gradle-
8888
89-
- name: Build
90-
uses: gradle/gradle-build-action@v2
89+
- name: Cache Konan
90+
uses: actions/cache@v2
91+
if: startsWith(matrix.config.os, 'macos')
9192
with:
92-
arguments: assembleRelease --scan
93+
path: |
94+
~/.konan/caches
95+
~/.konan/dependencies
96+
~/.konan/kotlin-native-prebuilt-macos-*
97+
key: ${{ runner.os }}-konan-${{ hashFiles('**/gradle/libs.versions.toml') }}
98+
restore-keys: |
99+
${{ runner.os }}-konan-
93100
94-
# TODO: Currently broken until build tools 34.0.0-rc3 is pre-installed in the runner
95-
# build-on-macos:
96-
# name: "Build on macOS"
97-
# runs-on: macos-latest
98-
# timeout-minutes: 30
99-
# steps:
100-
# - name: Checkout
101-
# uses: actions/checkout@v3
102-
#
103-
# - name: setup-java
104-
# uses: actions/setup-java@v3
105-
# with:
106-
# java-version: 17
107-
# distribution: adopt
108-
#
109-
# - uses: actions/cache@v3
110-
# with:
111-
# path: |
112-
# ~/.gradle/caches
113-
# ~/.gradle/wrapper
114-
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
115-
# restore-keys: |
116-
# ${{ runner.os }}-gradle-
117-
#
118-
# - name: Build
119-
# uses: gradle/gradle-build-action@v2
120-
# with:
121-
# arguments: assemble --scan
101+
- name: Build ${{ matrix.config.target }} targets
102+
continue-on-error: ${{ matrix.config.continueOnError }}
103+
uses: gradle/gradle-build-action@v2
104+
with:
105+
arguments: ${{ matrix.config.tasks }} --scan

.github/workflows/documentation.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 58 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,30 @@ jobs:
2323
java-version: 17
2424
distribution: adopt
2525

26+
- name: Cache Gradle
27+
uses: actions/cache@v3
28+
with:
29+
path: |
30+
~/.gradle/caches
31+
~/.gradle/wrapper
32+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
33+
restore-keys: |
34+
${{ runner.os }}-gradle-
35+
36+
- name: Cache Konan
37+
uses: actions/cache@v2
38+
with:
39+
path: |
40+
~/.konan/caches
41+
~/.konan/dependencies
42+
~/.konan/kotlin-native-prebuilt-macos-*
43+
key: ${{ runner.os }}-konan-${{ hashFiles('**/gradle/libs.versions.toml') }}
44+
restore-keys: |
45+
${{ runner.os }}-konan-
46+
47+
- name: Gradle Wrapper Validation
48+
uses: gradle/wrapper-validation-action@v1
49+
2650
- name: Deploy to Sonatype
2751
run: |
2852
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
@@ -37,14 +61,39 @@ jobs:
3761
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
3862
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
3963

40-
- name: Update README
41-
run: ./.github/version.sh "${{ env.DSC_VERSION }}"
64+
documentation:
65+
name: "Generate Documentation"
66+
runs-on: ubuntu-latest
67+
needs: release
68+
steps:
69+
- name: Checkout
70+
uses: actions/checkout@v3
71+
72+
- name: setup-java
73+
uses: actions/setup-java@v3
74+
with:
75+
java-version: 17
76+
distribution: adopt
77+
78+
- name: Cache Gradle
79+
uses: actions/cache@v3
80+
with:
81+
path: |
82+
~/.gradle/caches
83+
~/.gradle/wrapper
84+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
85+
restore-keys: |
86+
${{ runner.os }}-gradle-
87+
88+
- name: Gradle Wrapper Validation
89+
uses: gradle/wrapper-validation-action@v1
90+
91+
- name: Generate documentation
92+
uses: gradle/gradle-build-action@v2
93+
with:
94+
arguments: dokkaHtmlMultiModule
4295

43-
- name: Push Changes
44-
uses: EndBug/add-and-commit@v9
96+
- name: Deploy
97+
uses: JamesIves/github-pages-deploy-action@v4
4598
with:
46-
add: "./README.md"
47-
author_name: Jordon de Hoog
48-
author_email: jordon.dehoog@gmail.com
49-
message: "Update README for release ${{ env.DSC_VERSION }}"
50-
push: true
99+
folder: dokka/

.github/workflows/verify-gradle.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@
33
![Maven Central](https://img.shields.io/maven-central/v/com.dragselectcompose/dragselect)
44
[![Kotlin](https://img.shields.io/badge/kotlin-v1.8.20-blue.svg?logo=kotlin)](http://kotlinlang.org)
55
[![Build](https://github.com/jordond/drag-select-compose/actions/workflows/ci.yml/badge.svg)](https://github.com/jordond/drag-select-compose/actions/workflows/ci.yml)
6-
[![Verify Gradle](https://github.com/jordond/drag-select-compose/actions/workflows/verify-gradle.yml/badge.svg)](https://github.com/jordond/drag-select-compose/actions/workflows/verify-gradle.yml)
76
[![License](https://img.shields.io/github/license/jordond/drag-select-compose)](http://www.apache.org/licenses/LICENSE-2.0)
87

98
[![Compose Multiplatform](https://img.shields.io/badge/Compose%20Multiplatform-v1.4.1-blue)](https://github.com/JetBrains/compose-multiplatform)
109
![badge-android](http://img.shields.io/badge/platform-android-6EDB8D.svg?style=flat)
1110
![badge-ios](http://img.shields.io/badge/platform-ios-CDCDCD.svg?style=flat)
1211
![badge-desktop](http://img.shields.io/badge/platform-desktop-DB413D.svg?style=flat)
1312

14-
This is a Compose Multiplatform library that allows you to easily implement a "Google Photos"-style multi-selection in
15-
your Compose apps.
13+
This is a Compose Multiplatform library that allows you to easily implement a "Google Photos"-style
14+
multi-selection in your Compose apps.
1615

1716
You can view the KDocs at [docs.dragselectcompose.com](https://docs.dragselectcompose.com)
1817

@@ -36,7 +35,8 @@ You can view the KDocs at [docs.dragselectcompose.com](https://docs.dragselectco
3635
## Inspiration
3736

3837
This library was inspired by
39-
this [article](https://medium.com/androiddevelopers/create-a-photo-grid-with-multiselect-behavior-using-jetpack-compose-9a8d588a9b63) and
38+
this [article](https://medium.com/androiddevelopers/create-a-photo-grid-with-multiselect-behavior-using-jetpack-compose-9a8d588a9b63)
39+
and
4040
the [gist](https://gist.github.com/JolandaVerhoef/bcaf96360b92bba974e3796fe37247e2).
4141

4242
As well as the [drag-select-recyclerview](https://github.com/afollestad/drag-select-recyclerview)
@@ -248,7 +248,8 @@ indicator icons when the grid is in selection mode, and the item is selected or
248248
See the documentation for `LazyDragSelectVerticalGrid` and `SelectableItem` for all the options you
249249
can customize.
250250

251-
You can see a full example in [`LazyDragSelectPhotoGrid`](demo/android/src/main/kotlin/com/dragselectcompose/demo/LazyDragSelectPhotoGrid.kt)
251+
You can see a full example
252+
in [`LazyDragSelectPhotoGrid`](demo/android/src/main/kotlin/com/dragselectcompose/demo/LazyDragSelectPhotoGrid.kt)
252253

253254
## Demo
254255

build.gradle.kts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,14 @@ plugins {
1818
}
1919

2020
apiValidation {
21-
if (System.getenv("CI") == null) {
22-
ignoredProjects.addAll(
23-
listOf(
24-
"android",
25-
"androidApp",
26-
"desktopApp",
27-
"shared",
28-
),
29-
)
30-
}
21+
ignoredProjects.addAll(
22+
listOf(
23+
"android",
24+
"androidApp",
25+
"desktopApp",
26+
"shared",
27+
),
28+
)
3129
}
3230

3331
tasks.withType<DokkaMultiModuleTask>().configureEach {

settings.gradle.kts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,12 @@ gradleEnterprise {
3131

3232
rootProject.name = "DragSelectCompose"
3333

34-
if (System.getenv("CI") == null) {
35-
include(":demo:android")
36-
include(
37-
":demo:kmm:shared",
38-
":demo:kmm:desktopApp",
39-
":demo:kmm:androidApp",
40-
)
41-
}
34+
include(":demo:android")
35+
include(
36+
":demo:kmm:shared",
37+
":demo:kmm:desktopApp",
38+
":demo:kmm:androidApp",
39+
)
4240

4341
include(
4442
":dragselect",

0 commit comments

Comments
 (0)