kopia lustrzana https://github.com/felHR85/UsbSerial
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
rodzic
33fc1736da
commit
9d9c4183b6
|
@ -0,0 +1,28 @@
|
||||||
|
language: android
|
||||||
|
android:
|
||||||
|
components:
|
||||||
|
- tools
|
||||||
|
- platform-tools
|
||||||
|
# Note that the tools section appears twice on purpose as it’s 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
|
|
@ -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/).
|
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/).
|
||||||
|
|
||||||
|
|
|
@ -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/$/"/'
|
||||||
|
```
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
VERSION_NAME=1.0
|
VERSION_NAME=4.5.1
|
||||||
VERSION_CODE=1
|
VERSION_CODE=1
|
||||||
ANDROID_BUILD_MIN_SDK_VERSION=12
|
ANDROID_BUILD_MIN_SDK_VERSION=12
|
||||||
ANDROID_BUILD_TARGET_SDK_VERSION=27
|
ANDROID_BUILD_TARGET_SDK_VERSION=27
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
|
|
||||||
|
def artifact = "usbserial.jar"
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
group = 'com.felhr.usbserial'
|
group = 'com.felhr.usbserial'
|
||||||
version = '1.0.0'
|
version = project.VERSION_NAME
|
||||||
|
|
||||||
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
|
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
|
||||||
|
|
||||||
|
@ -16,11 +18,12 @@ android {
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION)
|
minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION)
|
||||||
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
|
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
|
||||||
|
archivesBaseName = "${project.name}-${project.VERSION_NAME}"
|
||||||
}
|
}
|
||||||
|
|
||||||
//noinspection GroovyAssignabilityCheck
|
//noinspection GroovyAssignabilityCheck
|
||||||
task deleteJar(type: org.gradle.api.tasks.Delete) {
|
task deleteJar(type: Delete) {
|
||||||
delete 'eclipse_lib/usbserial.jar'
|
delete "eclipse_lib/${artifact}"
|
||||||
}
|
}
|
||||||
|
|
||||||
//noinspection GroovyAssignabilityCheck
|
//noinspection GroovyAssignabilityCheck
|
||||||
|
@ -28,7 +31,7 @@ android {
|
||||||
from('build/intermediates/bundles/release/')
|
from('build/intermediates/bundles/release/')
|
||||||
into('eclipse_lib/')
|
into('eclipse_lib/')
|
||||||
include('classes.jar')
|
include('classes.jar')
|
||||||
rename('classes.jar', 'usbserial.jar')
|
rename('classes.jar', artifact)
|
||||||
}
|
}
|
||||||
|
|
||||||
createJar.dependsOn(deleteJar, build)
|
createJar.dependsOn(deleteJar, build)
|
||||||
|
|
Plik binarny nie jest wyświetlany.
Ładowanie…
Reference in New Issue