Automate Releases Using Travis CI and Github Releases

Add Travis CI config with github release support.
This should upload artifacts to GitHub release after
a tag is pushed to the repo. A way to automate the release.
It also makes builds on every branch that gets a commit push.

Add information on how to make a release for the project. This
is a separate markdown file detailing the procedure.
pull/141/head
Henry Addo 2018-01-06 07:14:09 +01:00
rodzic 33fc1736da
commit 9d9c4183b6
6 zmienionych plików z 53 dodań i 6 usunięć

28
.travis.yml 100644
Wyświetl plik

@ -0,0 +1,28 @@
language: android
android:
components:
- tools
- platform-tools
# Note that the tools section appears twice on purpose as its required to get the newest Android SDK tools.
# See: https://docs.travis-ci.com/user/languages/android/#Overview
- tools
- build-tools-27.0.2
- build-tools-26.0.2
- android-27
- android-26
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
before_script:
- export VERSION_TO_BUILD="$TRAVIS_TAG"
script: ./gradlew clean build
deploy:
provider: releases
api_key: $GITHUB_OAUTH_TOKEN
file: usbserial/build/outputs/aar/usbserial-${VERSION_TO_BUILD}-release.aar
skip_cleanup: true
on:
tags: true

Wyświetl plik

@ -1,4 +1,4 @@
UsbSerial [![](https://jitpack.io/v/felHR85/UsbSerial.svg)](https://jitpack.io/#felHR85/UsbSerial) [![AndroidArsenal](https://img.shields.io/badge/Android%20Arsenal-UsbSerial-green.svg?style=true)](https://android-arsenal.com/details/1/4162) [![Join the chat at https://gitter.im/UsbSerial/Lobby](https://badges.gitter.im/UsbSerial/Lobby.svg)](https://gitter.im/UsbSerial/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
UsbSerial [![Build Status](https://travis-ci.org/felHR85/UsbSerial.svg?branch=master)](https://travis-ci.org/felHR85/UsbSerial) [![](https://jitpack.io/v/felHR85/UsbSerial.svg)](https://jitpack.io/#felHR85/UsbSerial) [![AndroidArsenal](https://img.shields.io/badge/Android%20Arsenal-UsbSerial-green.svg?style=true)](https://android-arsenal.com/details/1/4162) [![Join the chat at https://gitter.im/UsbSerial/Lobby](https://badges.gitter.im/UsbSerial/Lobby.svg)](https://gitter.im/UsbSerial/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
=========
Usb serial controller for Android. For more information, there is [a more complete description](http://felhr85.net/2014/11/11/usbserial-a-serial-port-driver-library-for-android-v2-0/).

16
RELEASING.md 100644
Wyświetl plik

@ -0,0 +1,16 @@
Releasing
========
1. Change the `VERSION_NAME` value in `gradle.properties` to the version number to be released.
2. Update the `README.md` with the new version.
3. `./gradlew clean build`
4. `git commit -am "Prepare for release X.Y.Z."` (where X.Y.Z is the new version)
5. `git tag -a X.Y.Z -m "Version X.Y.Z"` -m "Changelog message 1" - m "Changelog message 2" -m "Changelog message 3"
6. `git push && git push --tags`
*Note:* To get the changelog messages from the commit history, issue
```shell
git log "$(git tag | tail -n2 | head -n1)..$(git tag | tail -n1)" --oneline --invert-grep --grep="Merge pull request" --grep="Prepare for release" | cut -d' ' -f2- | sed -E -e 's/^/-m "/' | sed -E -e 's/$/"/'
```

Wyświetl plik

@ -1,4 +1,4 @@
VERSION_NAME=1.0
VERSION_NAME=4.5.1
VERSION_CODE=1
ANDROID_BUILD_MIN_SDK_VERSION=12
ANDROID_BUILD_TARGET_SDK_VERSION=27

Wyświetl plik

@ -1,9 +1,11 @@
apply plugin: 'com.android.library'
def artifact = "usbserial.jar"
android {
group = 'com.felhr.usbserial'
version = '1.0.0'
version = project.VERSION_NAME
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
@ -16,11 +18,12 @@ android {
defaultConfig {
minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION)
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
archivesBaseName = "${project.name}-${project.VERSION_NAME}"
}
//noinspection GroovyAssignabilityCheck
task deleteJar(type: org.gradle.api.tasks.Delete) {
delete 'eclipse_lib/usbserial.jar'
task deleteJar(type: Delete) {
delete "eclipse_lib/${artifact}"
}
//noinspection GroovyAssignabilityCheck
@ -28,7 +31,7 @@ android {
from('build/intermediates/bundles/release/')
into('eclipse_lib/')
include('classes.jar')
rename('classes.jar', 'usbserial.jar')
rename('classes.jar', artifact)
}
createJar.dependsOn(deleteJar, build)

Plik binarny nie jest wyświetlany.