Skip to content

Commit

Permalink
GitHub CI Build and Auto-deployment
Browse files Browse the repository at this point in the history
- Added GitHub action for build tests
- Added GitHub action for auto-release when pushing to master
- Generate Version.txt which can be used when invoking GitHub hub release
- Fixed README
- Use standard GitHub .gitignore file
  • Loading branch information
valley-fordham authored and valley committed Jun 20, 2020
1 parent ff1c3b1 commit a4d29c1
Show file tree
Hide file tree
Showing 7 changed files with 158 additions and 31 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/android-build-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build & Publish Debug APK

on:
push:
branches:
- master

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Make Gradle executable
run: chmod +x ./gradlew
- name: Fix Gradle
run: gradle wrapper --stacktrace
- name: Build with Gradle
run: ./gradlew build --stacktrace
- name: Build Debug APK
run: ./gradlew assembleDebug --stacktrace
- name: Generate version.txt for Hub release
run: ./gradlew generateVersionTxt
- name: Releasing using Hub
uses: valley-fordham/action-release-debugapk@master
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
APP_FOLDER: mobile
RELEASE_TITLE: Carport Door Manager
21 changes: 21 additions & 0 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build

on:
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Make Gradle executable
run: chmod +x ./gradlew
- name: Fix Gradle
run: gradle wrapper --stacktrace
- name: Build with Gradle
run: ./gradlew build --stacktrace
83 changes: 63 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# built application files
# Built application files
*.apk
*.aar
*.ap_
*.aab

# files for the dex VM
# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# built native files (uncomment if you build your own)
# *.o
# *.so

# generated files
# Generated files
bin/
gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# release/

# Ignore gradle files
# Gradle files
.gradle/
build/

Expand All @@ -26,21 +27,63 @@ local.properties
# Proguard folder generated by Eclipse
proguard/

# Eclipse Metadata
.metadata/
# Log Files
*.log

# Mac OS X clutter
*.DS_Store
# Android Studio Navigation editor temp files
.navigation/

# Windows clutter
Thumbs.db
# Android Studio captures folder
captures/

# Intellij IDEA (see https://intellij-support.jetbrains.com/entries/23393067)
# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/datasources.xml
.idea/dataSources.ids
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml

# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
#*.keystore

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
.cxx/

# Google Services (e.g. APIs or Firebase)
# google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md

# Version control
vcs.xml

# lint
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/

# Added
.idea/
gradle
#project specific
version.txt
carportdooropener.iml
31 changes: 23 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
Carport Door Manager for Android

Features:
- big shiny button for opening/closing your carport door
- door status displayed on screen
- automatic background service checks the status of your door and displays a toast notification if open, will display an error if unavailable
- environment configurable - point to your home server and provide URL parameters which suit your environment
- app-side polling configurable - modify the interval of door status checks for both the main screen and background service
# Carport Door Manager for Android

Simple carport door controller, designed to interface with a home web server which can open/close/stop and return the status of your carport door.

### Features:
- Big shiny button for opening/closing/stopping your carport door
- Door status displayed on screen
- Automatic background service checks the status of your door and displays a toast notification if open, will display an error if unavailable
- Environment configurable - point to your home server and provide URL parameters which suit your environment
- App-side polling configurable - modify the interval of door status checks for both the main screen and background service

## Install
1. Setup a home web server that can listen for your web-hooks and operate the door/return its status
2. Download and install the latest [APK](https://github.com/valley-fordham/carportdoormanager/releases)

## Usage
1. Open the 'Door Manager' app, and click the 'Settings' spanner
2. Set the Host details and the URL parameters to suit your web server. (optional: modification of the default polling intervals is optional but not required)
3. Press the big button to open/close/stop your carport door (this may depend on how you've interfaced your web server with your carport door)
4. A message will report success or failure of the button trigger

## License
[![Creative Commons Licence](https://i.creativecommons.org/l/by-nc/4.0/88x31.png)](http://creativecommons.org/licenses/by-nc/4.0/)
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Sat Jun 20 19:49:05 ACST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
16 changes: 13 additions & 3 deletions mobile/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ android {
}

static def gitCommitNumber() {
def cmd = "git rev-list --count master" //this should be changed if branching occurs
def proc = cmd.execute()
return proc.text.trim().toInteger()
String commitNumber = "git rev-list --count HEAD --no-merges".execute().text.toString()
if (commitNumber.trim().isEmpty()) {
return 0
} else {
return commitNumber.trim().toInteger()
}
}

dependencies {
Expand All @@ -41,3 +44,10 @@ dependencies {
implementation files('libs/google-http-client-android-1.23.0.jar')
implementation files('libs/httpcore-4.0.1.jar')
}


task generateVersionTxt {
doLast {
file("./version.txt").text = android.defaultConfig.versionName
}
}

0 comments on commit a4d29c1

Please sign in to comment.