Skip to content

Commit

Permalink
Prep for publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Jawnnypoo committed Feb 16, 2022
1 parent 308dcdd commit 95aa2c1
Show file tree
Hide file tree
Showing 12 changed files with 124 additions and 40 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build

on: [push, pull_request]

jobs:
jvm:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
java-version:
- 11

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1

- name: Configure JDK
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: ${{ matrix.java-version }}

- name: Test
run: ./gradlew build
38 changes: 38 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish Release

on:
push:
tags:
- '*'

jobs:
publish:

runs-on: ubuntu-latest
if: github.repository == 'Commit451/TranslationViewDragHelper'

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Set version
run: sed -i "s/VERSION_NAME=0.0.1/VERSION_NAME=$GITHUB_REF_NAME/" gradle.properties

- name: Upload release
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}

- name: Publish release
run: ./gradlew closeAndReleaseRepository --no-daemon --no-parallel
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The current version of this helper is derived from `ViewDragHelper` source from
License
--------

Copyright 2018 Commit 451
Copyright 2022 Commit 451

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
11 changes: 5 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
apply plugin: "com.android.application"
apply plugin: "kotlin-android-extensions"
apply plugin: "kotlin-android"

android {
compileSdkVersion 29
compileSdkVersion 32

defaultConfig {
applicationId "com.commit451.betterviewdraghelper.sample"
applicationId "com.commit451.translationviewdraghelper.sample"
minSdkVersion 14
targetSdkVersion 29
targetSdkVersion 32
versionCode 1
versionName "1.0"
}
Expand All @@ -24,7 +23,7 @@ android {
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version")
implementation("androidx.appcompat:appcompat:1.1.0")
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version")
implementation("androidx.appcompat:appcompat:1.4.1")
implementation(project(":translationviewdraghelper"))
}
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
18 changes: 9 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
buildscript {
ext.kotlin_version = '1.3.61'
ext.kotlin_version = "1.6.10"
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath "com.android.tools.build:gradle:7.0.4"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath "com.vanniktech:gradle-maven-publish-plugin:0.18.0"
}
}

plugins {
id "com.github.ben-manes.versions" version "0.42.0"
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
26 changes: 25 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,28 @@
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# org.gradle.parallel=true
android.useAndroidX=true

GROUP=com.commit451
POM_ARTIFACT_ID=translationviewdraghelper
POM_PACKAGING=aar

POM_NAME=TranslationViewDragHelper
POM_DESCRIPTION=A version of ViewDragHelper which accounts for X and Y translations
POM_INCEPTION_YEAR=2016
POM_URL=https://github.com/Commit451/TranslationViewDragHelper/

POM_LICENSE_NAME=The Apache Software License, Version 2.0
POM_LICENSE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENSE_DIST=repo

POM_SCM_URL=https://github.com/Commit451/TranslationViewDragHelper/
POM_SCM_CONNECTION=scm:git:git://github.com/Commit451/TranslationViewDragHelper/.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://[email protected]/Commit451/TranslationViewDragHelper/.git

POM_DEVELOPER_ID=Commit451
POM_DEVELOPER_NAME=Commit 451
POM_DEVELOPER_URL=https://github.com/Commit451/

VERSION_NAME=0.0.1
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
6 changes: 6 additions & 0 deletions publish.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
mavenPublish {
sonatypeHost = "S01"
// We need this, because on Jitpack, we don't want the release to be signed,
// but on GitHub actions, we do, since it will be published to Maven Central
releaseSigningEnabled = System.getenv("RELEASE_SIGNING_ENABLED") == "true"
}
12 changes: 6 additions & 6 deletions translationviewdraghelper/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
apply plugin: "com.vanniktech.maven.publish"
apply from: "../publish.gradle"

android {
compileSdkVersion 29
compileSdkVersion 32

defaultConfig {
minSdkVersion 14
targetSdkVersion 29
targetSdkVersion 32
versionCode 1
versionName "1.0"
}
Expand All @@ -22,8 +24,6 @@ android {
}

dependencies {
api("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version")
api("androidx.core:core:1.1.0")
api("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version")
api("androidx.core:core-ktx:1.7.0")
}

apply from: "https://raw.githubusercontent.com/Commit451/gradle-android-javadocs/1.1.0/gradle-android-javadocs.gradle"
6 changes: 1 addition & 5 deletions translationviewdraghelper/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.commit451.translationviewdraghelper">

<application />

</manifest>
package="com.commit451.translationviewdraghelper"/>

0 comments on commit 95aa2c1

Please sign in to comment.