Skip to content

Commit 95aa2c1

Browse files
committed
Prep for publish
1 parent 308dcdd commit 95aa2c1

File tree

12 files changed

+124
-40
lines changed

12 files changed

+124
-40
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
jvm:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
java-version:
13+
- 11
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
19+
- name: Validate Gradle Wrapper
20+
uses: gradle/wrapper-validation-action@v1
21+
22+
- name: Configure JDK
23+
uses: actions/setup-java@v2
24+
with:
25+
distribution: 'zulu'
26+
java-version: ${{ matrix.java-version }}
27+
28+
- name: Test
29+
run: ./gradlew build
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
publish:
10+
11+
runs-on: ubuntu-latest
12+
if: github.repository == 'Commit451/TranslationViewDragHelper'
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Install JDK 11
19+
uses: actions/setup-java@v1
20+
with:
21+
java-version: 11
22+
23+
- name: Set version
24+
run: sed -i "s/VERSION_NAME=0.0.1/VERSION_NAME=$GITHUB_REF_NAME/" gradle.properties
25+
26+
- name: Upload release
27+
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel
28+
env:
29+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
30+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
31+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }}
32+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
33+
34+
- name: Publish release
35+
run: ./gradlew closeAndReleaseRepository --no-daemon --no-parallel
36+
env:
37+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
38+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}

.travis.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The current version of this helper is derived from `ViewDragHelper` source from
4040
License
4141
--------
4242

43-
Copyright 2018 Commit 451
43+
Copyright 2022 Commit 451
4444

4545
Licensed under the Apache License, Version 2.0 (the "License");
4646
you may not use this file except in compliance with the License.

app/build.gradle

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
apply plugin: "com.android.application"
2-
apply plugin: "kotlin-android-extensions"
32
apply plugin: "kotlin-android"
43

54
android {
6-
compileSdkVersion 29
5+
compileSdkVersion 32
76

87
defaultConfig {
9-
applicationId "com.commit451.betterviewdraghelper.sample"
8+
applicationId "com.commit451.translationviewdraghelper.sample"
109
minSdkVersion 14
11-
targetSdkVersion 29
10+
targetSdkVersion 32
1211
versionCode 1
1312
versionName "1.0"
1413
}
@@ -24,7 +23,7 @@ android {
2423
}
2524

2625
dependencies {
27-
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version")
28-
implementation("androidx.appcompat:appcompat:1.1.0")
26+
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version")
27+
implementation("androidx.appcompat:appcompat:1.4.1")
2928
implementation(project(":translationviewdraghelper"))
3029
}

app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
android:label="@string/app_name"
99
android:supportsRtl="true"
1010
android:theme="@style/AppTheme">
11-
<activity android:name=".MainActivity">
11+
<activity
12+
android:name=".MainActivity"
13+
android:exported="true">
1214
<intent-filter>
1315
<action android:name="android.intent.action.MAIN" />
1416

build.gradle

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
buildscript {
2-
ext.kotlin_version = '1.3.61'
2+
ext.kotlin_version = "1.6.10"
33
repositories {
44
google()
5-
jcenter()
5+
mavenCentral()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:3.5.3'
8+
classpath "com.android.tools.build:gradle:7.0.4"
99
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10-
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
10+
classpath "com.vanniktech:gradle-maven-publish-plugin:0.18.0"
1111
}
1212
}
1313

14+
plugins {
15+
id "com.github.ben-manes.versions" version "0.42.0"
16+
}
17+
1418
allprojects {
1519
repositories {
1620
google()
17-
jcenter()
21+
mavenCentral()
1822
}
1923
}
20-
21-
task clean(type: Delete) {
22-
delete rootProject.buildDir
23-
}

gradle.properties

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,28 @@
1515
# When configured, Gradle will run in incubating parallel mode.
1616
# This option should only be used with decoupled projects. More details, visit
1717
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18-
# org.gradle.parallel=true
18+
# org.gradle.parallel=true
19+
android.useAndroidX=true
20+
21+
GROUP=com.commit451
22+
POM_ARTIFACT_ID=translationviewdraghelper
23+
POM_PACKAGING=aar
24+
25+
POM_NAME=TranslationViewDragHelper
26+
POM_DESCRIPTION=A version of ViewDragHelper which accounts for X and Y translations
27+
POM_INCEPTION_YEAR=2016
28+
POM_URL=https://github.com/Commit451/TranslationViewDragHelper/
29+
30+
POM_LICENSE_NAME=The Apache Software License, Version 2.0
31+
POM_LICENSE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt
32+
POM_LICENSE_DIST=repo
33+
34+
POM_SCM_URL=https://github.com/Commit451/TranslationViewDragHelper/
35+
POM_SCM_CONNECTION=scm:git:git://github.com/Commit451/TranslationViewDragHelper/.git
36+
POM_SCM_DEV_CONNECTION=scm:git:ssh://[email protected]/Commit451/TranslationViewDragHelper/.git
37+
38+
POM_DEVELOPER_ID=Commit451
39+
POM_DEVELOPER_NAME=Commit 451
40+
POM_DEVELOPER_URL=https://github.com/Commit451/
41+
42+
VERSION_NAME=0.0.1

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip

publish.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
mavenPublish {
2+
sonatypeHost = "S01"
3+
// We need this, because on Jitpack, we don't want the release to be signed,
4+
// but on GitHub actions, we do, since it will be published to Maven Central
5+
releaseSigningEnabled = System.getenv("RELEASE_SIGNING_ENABLED") == "true"
6+
}

0 commit comments

Comments
 (0)