-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build/ci: configure jgitver for automated versioning and configure mi…
…sc ci stuff (#11)
- Loading branch information
Showing
14 changed files
with
186 additions
and
128 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,44 @@ | ||
name: 'Execute with AVD' | ||
description: 'Set up an Android virtual device, cache it, and run a script' | ||
--- | ||
name: "Execute with AVD" | ||
description: "Set up an Android virtual device, cache it, and run a script" | ||
inputs: | ||
api-level: | ||
description: 'API level of the platform system image' | ||
description: "API level of the platform system image" | ||
required: true | ||
script: | ||
description: 'Custom script to run' | ||
description: "Custom script to run" | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Configure KVM | ||
shell: bash | ||
- name: "Configure KVM" | ||
shell: "bash" | ||
run: | | ||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
sudo udevadm control --reload-rules | ||
sudo udevadm trigger --name-match=kvm | ||
- name: Cache AVD | ||
uses: actions/cache@v4 | ||
id: avd-cache | ||
- name: "Cache AVD" | ||
uses: "actions/cache@v4" | ||
id: "avd-cache" | ||
with: | ||
path: | | ||
~/.android/avd/* | ||
~/.android/adb* | ||
key: avd-v${{ inputs.api-level }} | ||
- name: Create AVD for caching | ||
if: steps.avd-cache.outputs.cache-hit != 'true' | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
key: "avd-v${{ inputs.api-level }}" | ||
- name: "Create AVD for caching" | ||
if: "steps.avd-cache.outputs.cache-hit != 'true'" | ||
uses: "reactivecircus/android-emulator-runner@v2" | ||
with: | ||
api-level: ${{ inputs.api-level }} | ||
arch: x86_64 | ||
api-level: "${{ inputs.api-level }}" | ||
arch: "x86_64" | ||
force-avd-creation: false | ||
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
script: echo "Generated AVD snapshot for caching." | ||
- name: ${{ inputs.script }} | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
emulator-options: "-no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none" | ||
script: "echo 'Generated AVD snapshot for caching.'" | ||
- name: "${{ inputs.script }}" | ||
uses: "reactivecircus/android-emulator-runner@v2" | ||
with: | ||
api-level: ${{ inputs.api-level }} | ||
arch: x86_64 | ||
api-level: "${{ inputs.api-level }}" | ||
arch: "x86_64" | ||
force-avd-creation: false | ||
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
script: ${{ inputs.script }} | ||
emulator-options: "-no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none" | ||
script: "${{ inputs.script }}" |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,121 @@ | ||
name: CI | ||
--- | ||
name: "CI" | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
branches: ["main"] | ||
pull_request: | ||
branches: [ "main" ] | ||
branches: ["main"] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
group: "${{ github.workflow }}-${{ github.ref }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check-format: | ||
runs-on: ubuntu-latest | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/setup | ||
- run: ./gradlew spotlessCheck | ||
- uses: "actions/checkout@v4" | ||
with: | ||
fetch-depth: 0 | ||
- uses: "./.github/actions/setup" | ||
- run: "./gradlew spotlessCheck" | ||
|
||
check-podspec: | ||
runs-on: "macos-latest" | ||
steps: | ||
- uses: "actions/checkout@v4" | ||
with: | ||
fetch-depth: 0 | ||
- uses: "./.github/actions/setup" | ||
- run: "./gradlew podInstall" | ||
- run: | | ||
git diff -I '^COCOAPODS: [0-9]+\.[0-9]+\.[0-9]+$' --exit-code | ||
lint-android: | ||
runs-on: ubuntu-latest | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/setup | ||
- run: ./gradlew lint | ||
- uses: "actions/checkout@v4" | ||
with: | ||
fetch-depth: 0 | ||
- uses: "./.github/actions/setup" | ||
- run: "./gradlew lint" | ||
|
||
test-android: | ||
runs-on: ubuntu-latest | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/setup | ||
- name: Run with AVD ./gradlew connectedDebugAndroidTest | ||
uses: ./.github/actions/run-with-avd | ||
- uses: "actions/checkout@v4" | ||
with: | ||
fetch-depth: 0 | ||
- uses: "./.github/actions/setup" | ||
- name: "Run with AVD ./gradlew connectedDebugAndroidTest" | ||
uses: "./.github/actions/run-with-avd" | ||
with: | ||
api-level: 35 | ||
script: ./gradlew connectedDebugAndroidTest | ||
script: "./gradlew connectedDebugAndroidTest" | ||
|
||
test-ios: | ||
runs-on: macos-latest | ||
runs-on: "macos-latest" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/setup | ||
- run: ./gradlew iosSimulatorArm64Test | ||
- uses: "actions/checkout@v4" | ||
with: | ||
fetch-depth: 0 | ||
- uses: "./.github/actions/setup" | ||
- run: "./gradlew iosSimulatorArm64Test" | ||
|
||
build-docs: | ||
runs-on: macos-latest | ||
runs-on: "macos-latest" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/setup | ||
- run: ./gradlew dokkaHtmlMultiModule | ||
- uses: actions/upload-pages-artifact@v3 | ||
- uses: "actions/checkout@v4" | ||
with: | ||
path: build/dokka/htmlMultiModule | ||
fetch-depth: 0 | ||
- uses: "./.github/actions/setup" | ||
- run: "./gradlew dokkaHtmlMultiModule" | ||
- uses: "actions/upload-pages-artifact@v3" | ||
with: | ||
path: "build/dokka/htmlMultiModule" | ||
|
||
build-android-app: | ||
runs-on: ubuntu-latest | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/setup | ||
- run: ./gradlew packageDebug packageRelease | ||
- uses: actions/upload-artifact@v4 | ||
- uses: "actions/checkout@v4" | ||
with: | ||
if-no-files-found: error | ||
name: demo-app-debug | ||
path: demo-app/build/outputs/apk/debug/demo-app-debug.apk | ||
- uses: actions/upload-artifact@v4 | ||
fetch-depth: 0 | ||
- uses: "./.github/actions/setup" | ||
- run: "./gradlew packageDebug" | ||
- uses: "actions/upload-artifact@v4" | ||
with: | ||
if-no-files-found: error | ||
name: demo-app-release-unsigned | ||
path: demo-app/build/outputs/apk/release/demo-app-release-unsigned.apk | ||
if-no-files-found: "error" | ||
name: "demo-app-debug" | ||
path: "demo-app/build/outputs/apk/debug/demo-app-debug.apk" | ||
|
||
publish-snapshot: | ||
needs: [test-android, test-ios] | ||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
runs-on: macos-latest | ||
needs: | ||
- "test-android" | ||
- "test-ios" | ||
if: "${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}" | ||
runs-on: "macos-latest" | ||
permissions: | ||
packages: write | ||
packages: "write" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/setup | ||
- run: ./gradlew publishAllPublicationsToGitHubPackagesRepository | ||
- uses: "actions/checkout@v4" | ||
with: | ||
fetch-depth: 0 | ||
- uses: "./.github/actions/setup" | ||
- run: "./gradlew publishAllPublicationsToGitHubPackagesRepository" | ||
env: | ||
ORG_GRADLE_PROJECT_githubToken: ${{ secrets.GITHUB_TOKEN }} | ||
ORG_GRADLE_PROJECT_githubUser: ${{ github.actor }} | ||
ORG_GRADLE_PROJECT_githubToken: "${{ secrets.GITHUB_TOKEN }}" | ||
ORG_GRADLE_PROJECT_githubUser: "${{ github.actor }}" | ||
|
||
all-good: | ||
needs: [check-format, lint-android, test-android, test-ios, build-docs, build-android-app] | ||
runs-on: ubuntu-latest | ||
needs: | ||
- "check-format" | ||
- "check-podspec" | ||
- "lint-android" | ||
- "test-android" | ||
- "test-ios" | ||
- "build-docs" | ||
- "build-android-app" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- run: echo "All checks passed!" | ||
- run: "echo 'All checks passed!'" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
name: Dependency Submission | ||
--- | ||
name: "Dependency Submission" | ||
|
||
on: | ||
push: | ||
branches: [ 'main' ] | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
dependency-submission: | ||
runs-on: ubuntu-latest | ||
runs-on: "ubuntu-latest" | ||
permissions: | ||
contents: write | ||
contents: "write" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
- uses: "actions/checkout@v4" | ||
- uses: "actions/setup-java@v4" | ||
with: | ||
distribution: temurin | ||
distribution: "temurin" | ||
java-version: 21 | ||
- uses: gradle/actions/dependency-submission@v4 | ||
- uses: "gradle/actions/dependency-submission@v4" | ||
with: | ||
build-scan-publish: true | ||
build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use" | ||
build-scan-terms-of-use-agree: "yes" | ||
- uses: advanced-security/[email protected] | ||
- uses: "advanced-security/[email protected]" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,46 @@ | ||
name: Release | ||
--- | ||
name: "Release" | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: ["v*.*.*"] | ||
|
||
jobs: | ||
publish-maven: | ||
runs-on: macos-latest | ||
runs-on: "macos-latest" | ||
environment: | ||
name: maven-central | ||
url: https://central.sonatype.com/namespace/dev.sargunv.maplibre-compose | ||
name: "maven-central" | ||
url: "https://central.sonatype.com/namespace/dev.sargunv.maplibre-compose" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/setup | ||
- run: ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache | ||
- uses: "actions/checkout@v4" | ||
with: | ||
fetch-depth: 0 | ||
- uses: "./.github/actions/setup" | ||
- run: "./gradlew publishAndReleaseToMavenCentral --no-configuration-cache" | ||
env: | ||
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | ||
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | ||
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_PRIVATE_KEY }} | ||
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSPHRASE }} | ||
ORG_GRADLE_PROJECT_mavenCentralUsername: "${{ secrets.MAVEN_CENTRAL_USERNAME }}" | ||
ORG_GRADLE_PROJECT_mavenCentralPassword: "${{ secrets.MAVEN_CENTRAL_PASSWORD }}" | ||
ORG_GRADLE_PROJECT_signingInMemoryKey: "${{ secrets.GPG_PRIVATE_KEY }}" | ||
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: "${{ secrets.GPG_PASSPHRASE }}" | ||
|
||
publish-pages: | ||
needs: [publish-maven] | ||
runs-on: macos-latest | ||
needs: | ||
- "publish-maven" | ||
runs-on: "macos-latest" | ||
permissions: | ||
pages: write | ||
id-token: write | ||
pages: "write" | ||
id-token: "write" | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deploy-pages.outputs.page_url }} | ||
name: "github-pages" | ||
url: "${{ steps.deploy-pages.outputs.page_url }}" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/setup | ||
- run: ./gradlew dokkaHtmlMultiModule | ||
- uses: actions/upload-pages-artifact@v3 | ||
- uses: "actions/checkout@v4" | ||
with: | ||
fetch-depth: 0 | ||
- uses: "./.github/actions/setup" | ||
- run: "./gradlew dokkaHtmlMultiModule" | ||
- uses: "actions/upload-pages-artifact@v3" | ||
with: | ||
path: build/dokka/htmlMultiModule | ||
- uses: actions/deploy-pages@v4 | ||
id: deploy-pages | ||
path: "build/dokka/htmlMultiModule" | ||
- uses: "actions/deploy-pages@v4" | ||
id: "deploy-pages" |
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
Oops, something went wrong.