diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..d0ebd4b --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,16 @@ +changelog: + exclude: + labels: + - ignore-for-release + authors: + - octocat + categories: + - title: "๐Ÿชฒ Bug Fixes" + labels: + - bug + - title: "โœจ New Features" + labels: + - enhancement + - title: "๐Ÿ“„ Other Changes" + labels: + - "*" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e89e20f..37a6dfe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,32 +1,71 @@ name: CI + on: push + jobs: - build: + gradle-build: + name: ๐Ÿ—๏ธ Gradle build + runs-on: ubuntu-latest + steps: + - name: ๐Ÿ“ฅ Check-out + uses: actions/checkout@v4 + - name: ๐Ÿงฐ Install JDK + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + cache: gradle + - name: ๐Ÿ—๏ธ Build with Gradle + run: ./gradlew build + gradle-lint: + name: ๐Ÿงช Gradle LINT + runs-on: ubuntu-latest + steps: + - name: ๐Ÿ“ฅ Check-out + uses: actions/checkout@v4 + - name: ๐Ÿงฐ Install JDK + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + cache: gradle + - name: ๐Ÿงช Lint with Gradle + run: ./gradlew lint + gradle-test: + name: ๐Ÿงช Gradle test + runs-on: ubuntu-latest + steps: + - name: ๐Ÿ“ฅ Check-out + uses: actions/checkout@v4 + - name: ๐Ÿงฐ Install JDK + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + cache: gradle + - name: ๐Ÿงช Test with Gradle + run: ./gradlew test + gradle-integration-test: + name: ๐Ÿงช Gradle integration test runs-on: ubuntu-latest steps: - name: ๐Ÿ“ฅ Check-out uses: actions/checkout@v4 - - name: ๐Ÿงฐ Enable KVM - 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: ๐Ÿงฐ Install JDK uses: actions/setup-java@v4 with: java-version: 17 distribution: temurin cache: gradle + - name: ๐Ÿงฐ Enable KVM + 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: ๐Ÿงฐ Install Android SDK uses: malinskiy/action-android/install-sdk@release/0.1.6 with: acceptLicense: yes - - name: ๐Ÿ— Build - run: ./gradlew assembleDebug - - name: ๐Ÿงช Android LINT - run: ./gradlew lint - - name: ๐Ÿงช Unit test - run: ./gradlew test - name: ๐Ÿงช Integration test uses: malinskiy/action-android/emulator-run-cmd@release/0.1.6 with: @@ -34,3 +73,25 @@ jobs: api: 25 tag: google_apis abi: x86 + github-release: + name: ๐Ÿš€ Create GitHub release + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + needs: + - gradle-build + - gradle-lint + - gradle-test + - gradle-integration-test + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - name: ๐Ÿ“ฅ Check-out + uses: actions/checkout@v3 + - name: ๐Ÿš€ Create GitHub release + uses: softprops/action-gh-release@v1 + with: + name: Release ${{ github.ref_name }} + fail_on_unmatched_files: true + draft: false + prerelease: false + generate_release_notes: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 6b0a02c..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Create release - -on: - push: - tags: # Push events to new versions, e.g., 1.0, 20.15.10 - - "[0-9]+.[0-9]+" - - "[0-9]+.[0-9]+.[0-9]+" - - "[0-9]+.[0-9]+-*" - - "[0-9]+.[0-9]+.[0-9]+-*" - -jobs: - build: - name: "๐Ÿš€ Release" - runs-on: ubuntu-latest - steps: - - name: "๐Ÿ“ฅ Check-out" - uses: actions/checkout@v4 - - name: "๐Ÿท๏ธ Get version tag" - id: get-version - run: echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//} - - name: "โœ๏ธ Generate changelog" - id: generate-changelog - if: runner.os == 'Linux' - uses: heinrichreimer/action-github-changelog-generator@v2 - with: - onlyLastTag: "true" - stripHeaders: "true" - stripGeneratorNotice: "true" - - name: "๐Ÿ“ค Upload changelog" - uses: actions/upload-artifact@v4 - with: - name: "Changelog" - path: CHANGELOG.md - - name: "๐Ÿš€ Create GitHub release" - id: create-github-release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ steps.get-version.outputs.tag }} - body: ${{ steps.generate-changelog.outputs.changelog }} - prerelease: false diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c5f3f6b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.configuration.updateBuildConfiguration": "interactive" +} \ No newline at end of file diff --git a/app/app-release.apk b/app/app-release.apk deleted file mode 100644 index 146fbd1..0000000 Binary files a/app/app-release.apk and /dev/null differ diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index 082b4a2..0000000 --- a/app/build.gradle +++ /dev/null @@ -1,46 +0,0 @@ -apply plugin: 'com.android.application' - -def versionMajor = 1 -def versionMinor = 6 -def versionPatch = 2 -def versionBuild = 0 // bump for dogfood builds, public betas, etc. - -android { - compileSdkVersion 29 - - defaultConfig { - applicationId "com.heinrichreimersoftware.materialintro.demo" - minSdkVersion 15 - targetSdkVersion 29 - versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionBuild - versionName "${versionMajor}.${versionMinor}" + (versionPatch == 0 ? "" : ".${versionPatch}") - } - - lintOptions { - abortOnError false - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - - dataBinding { - enabled = true - } -} - -dependencies { - implementation project(':library') - //Support - implementation 'androidx.appcompat:appcompat:1.1.0' - implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation 'com.google.android.material:material:1.0.0' - //Firebase - implementation 'com.google.firebase:firebase-core:16.0.6' - implementation 'com.google.firebase:firebase-crash:16.2.1' -} - -apply plugin: 'com.google.gms.google-services' diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 0000000..98a7ccc --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,46 @@ +plugins { + id("com.android.application") + id("com.google.gms.google-services") + id("com.palantir.git-version") +} + +android { + namespace = "com.heinrichreimersoftware.materialintro.demo" + + compileSdk = 29 + + defaultConfig { + applicationId = "com.heinrichreimersoftware.materialintro.demo" + minSdk = 15 + targetSdk = 29 + versionCode = 20000 + versionName = gitVersion() + } + + lintOptions { + abortOnError = false + } + + buildTypes { + getByName("release") { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android.txt"), + "proguard-rules.pro" + ) + } + } + + dataBinding { + enabled = true + } +} + +dependencies { + implementation(project(":library")) + implementation("androidx.appcompat:appcompat:1.1.0") + implementation("androidx.legacy:legacy-support-v4:1.0.0") + implementation("com.google.android.material:material:1.0.0") + implementation("com.google.firebase:firebase-core:16.0.6") + implementation("com.google.firebase:firebase-crash:16.2.1") +} diff --git a/build.gradle b/build.gradle deleted file mode 100644 index ecf5100..0000000 --- a/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - jcenter() - google() - } - dependencies { - classpath 'com.android.tools.build:gradle:3.5.0' - classpath 'com.google.gms:google-services:4.4.1' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - jcenter() - google() - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..4d19d9e --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,6 @@ +plugins { + id("com.android.application") version "8.3.0" apply false + id("com.android.library") version "8.3.0" apply false + id("com.google.gms.google-services") version "4.4.1" apply false + id("com.palantir.git-version") version "3.0.0" apply false +} diff --git a/library/build.gradle b/library/build.gradle deleted file mode 100644 index 1148087..0000000 --- a/library/build.gradle +++ /dev/null @@ -1,33 +0,0 @@ -apply plugin: 'com.android.library' - -def versionMajor = 2 -def versionMinor = 0 -def versionPatch = 0 -def versionBuild = 0 // bump for dogfood builds, public betas, etc. - -android { - compileSdkVersion 29 - - defaultConfig { - minSdkVersion 15 - targetSdkVersion 29 - versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionBuild - versionName "${versionMajor}.${versionMinor}" + (versionPatch == 0 ? "" : ".${versionPatch}") - } - - lintOptions { - abortOnError false - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } -} - -dependencies { - implementation 'androidx.appcompat:appcompat:1.1.0' - implementation 'androidx.constraintlayout:constraintlayout:1.1.3' -} diff --git a/library/build.gradle.kts b/library/build.gradle.kts new file mode 100644 index 0000000..b813371 --- /dev/null +++ b/library/build.gradle.kts @@ -0,0 +1,36 @@ +plugins { + id("com.android.library") + id("com.palantir.git-version") +} + +android { + namespace = "com.heinrichreimersoftware.materialintro" + + compileSdk = 29 + + defaultConfig { + minSdk = 15 + targetSdk = 29 + versionCode = 20000 + versionName = gitVersion() + } + + lintOptions { + abortOnError = false + } + + buildTypes { + getByName("release") { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android.txt"), + "proguard-rules.pro" + ) + } + } +} + +dependencies { + implementation("androidx.appcompat:appcompat:1.1.0") + implementation("androidx.constraintlayout:constraintlayout:1.1.3") +} diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 3306997..0000000 --- a/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':app', ':library' diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..f2d35ec --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,21 @@ +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + + +rootProject.name = "material-intro" + +include(":app") +include(":library")