Skip to content

Commit

Permalink
feat: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
agronick committed Dec 15, 2023
1 parent 9955b56 commit 70066ea
Show file tree
Hide file tree
Showing 7 changed files with 146 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

# These are supported funding model platforms
github: agronick
custom: ["https://www.paypal.me/kagronick"]
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Bug report
about: Please write your issue in English. Check the discussions page if this is not a bug.
title: "[BUG]"
labels: ''
assignees: ''

---

| :exclamation: Please write your issue in English |
|---------------------------------------------------|

**Describe the bug**
Check the discussions page if this is not a bug. A clear and concise description of what the bug is.
Be as descriptive as possible. Check
the [discussions](https://github.com/agronick/aa-torque/discussions)
page first. If this is not a bug, you can make a post on the discussions page.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[REQUEST]"
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
91 changes: 91 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: ci
on: [ push ]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '19'

- name: Cache Gradle and wrapper
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}

- name: Build Release apk
run: ./gradlew lintRelease

build_deploy:
runs-on: ubuntu-latest
permissions:
contents: write
discussions: write
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2

- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '19'

- name: Restore keystore
run: echo ${{ secrets.DEBUG_KEYSTORE }} | base64 -d > $HOME/debug.keystore

- name: Cache Gradle and wrapper
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}

- name: Bump version
id: bump_version
if: github.repository == 'agronick/flattery'
uses: oflynned/android-version-bump@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: rickstaa/action-create-tag@v1
id: "tag_create"
with:
tag: "latest"
tag_exists_error: false
force_push_tag: true
message: "Latest release"

- name: Build Release apk
if: github.repository == 'agronick/flattery'
run: >
./gradlew assembleRelease
-Pandroid.injected.signing.store.file=$HOME/debug.keystore
-Pandroid.injected.signing.key.alias=androiddebugkey
-Pandroid.injected.signing.store.password=android
-Pandroid.injected.signing.key.password=android
- name: Build Release apk for forked repos
if: github.repository != 'agronick/flattery'
run: >
./gradlew assembleRelease
- name: Rename release
run: mv app/build/outputs/apk/release/app-release.apk app/build/outputs/apk/release/flattery.apk

- name: Create Github Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.bump_version.outputs.new_tag || 'latest' }}
name: ${{ steps.bump_version.outputs.new_tag || 'latest' }}
generate_release_notes: true
draft: true
files: |
app/build/outputs/apk/release/flattery.apk
app/build/outputs/mapping/release/mapping.txt
14 changes: 10 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

Properties props = new Properties()
props.load(new FileInputStream("$project.rootDir/version.properties"))

def versionMajor = props.getProperty("majorVersion") as Integer
def versionMinor = props.getProperty("minorVersion") as Integer
def versionPatch = props.getProperty("patchVersion") as Integer

android {
compileSdk 34
namespace = "com.agronick.launcher"
Expand All @@ -9,9 +16,8 @@ android {
applicationId "com.agronick.launcher"
minSdkVersion 28
targetSdkVersion 34
versionCode 1
versionName "1.0"

versionCode versionMajor * 100 + versionMinor * 10 + versionPatch
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
}

buildTypes {
Expand All @@ -26,7 +32,7 @@ android {
targetCompatibility JavaVersion.VERSION_19
}

kotlinOptions{
kotlinOptions {
jvmTarget = JavaVersion.VERSION_19
}
}
Expand Down
Binary file removed gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 4 additions & 0 deletions version.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
majorVersion=0
minorVersion=0
patchVersion=0
buildNumber=

0 comments on commit 70066ea

Please sign in to comment.