Skip to content

Commit 3108fdc

Browse files
authored
resolves #84 migrate to GitHub Actions (#85)
1 parent ad45726 commit 3108fdc

File tree

6 files changed

+64
-65
lines changed

6 files changed

+64
-65
lines changed

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
3+
version: 2
4+
updates:
5+
- package-ecosystem: "gradle"
6+
directory: "/"
7+
schedule:
8+
interval: "daily"
9+
10+
- package-ecosystem: "github-actions"
11+
directory: "/"
12+
schedule:
13+
interval: "daily"

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
name: Test
6+
if: "!startsWith(github.ref, 'refs/tags/')"
7+
strategy:
8+
matrix:
9+
include:
10+
- java: 8
11+
- java: 11
12+
- java: 15
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
- name: Set up Java
18+
uses: actions/setup-java@v1
19+
with:
20+
java-version: ${{ matrix.java }}
21+
- name: Run tests
22+
uses: eskatos/gradle-command-action@v1
23+
with:
24+
arguments: test
25+
publish:
26+
runs-on: ubuntu-latest
27+
needs: [ test ]
28+
if: github.repository == 'bozaro/git-as-svn' && github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v2
32+
- name: Set up Java
33+
uses: actions/setup-java@v1
34+
with:
35+
java-version: 8 # Build releases using oldest supported jdk
36+
- name: Publish to Sonatype
37+
uses: eskatos/gradle-command-action@v1
38+
env:
39+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
40+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
41+
with:
42+
arguments: publish closeAndReleaseRepository

.travis.yml

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

README.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
= git-lfs-java
2+
:project-handle: git-lfs-java
3+
:slug: bozaro/{project-handle}
4+
:uri-project: https://github.com/{slug}
5+
:uri-ci: {uri-project}/actions?query=branch%3Amaster
26

3-
image:https://travis-ci.org/bozaro/git-lfs-java.svg?branch=master[Build Status,link=https://travis-ci.org/bozaro/git-lfs-java]
7+
image:{uri-project}/workflows/CI/badge.svg?branch=master[Build Status,link={uri-ci}]
48
image:https://img.shields.io/maven-central/v/ru.bozaro.gitlfs/gitlfs-common.svg[Maven Central,link=http://mvnrepository.com/artifact/ru.bozaro.gitlfs]
59

610
== What is this?

build.gradle.kts

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import de.marcphilipp.gradle.nexus.NexusPublishExtension
2+
import org.ajoberstar.grgit.Grgit
23
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
34
import org.gradle.plugins.ide.idea.model.IdeaLanguageLevel
45
import java.time.Duration
56

67
val ossrhUsername: String? = System.getenv("OSSRH_USERNAME")
78
val ossrhPassword: String? = System.getenv("OSSRH_PASSWORD")
8-
val signingPassword: String? = System.getenv("SIGNING_PASSWORD")
9-
val gitCommit = System.getenv("TRAVIS_COMMIT") ?: ""
109

1110
tasks.wrapper {
1211
gradleVersion = "6.8.1"
@@ -17,6 +16,7 @@ plugins {
1716
id("com.github.ben-manes.versions") version "0.36.0"
1817
id("de.marcphilipp.nexus-publish") version "0.4.0" apply false
1918
id("io.codearte.nexus-staging") version "0.22.0"
19+
id("org.ajoberstar.grgit") version "4.1.0"
2020
idea
2121
}
2222

@@ -42,7 +42,6 @@ idea {
4242
subprojects {
4343
apply(plugin = "java-library")
4444
apply(plugin = "maven-publish")
45-
apply(plugin = "signing")
4645
apply(plugin = "de.marcphilipp.nexus-publish")
4746

4847
configure<JavaPluginExtension> {
@@ -100,7 +99,7 @@ subprojects {
10099
}
101100

102101
configure<NexusPublishExtension> {
103-
// We're constantly getting socket timeouts on Travis
102+
// We're constantly getting socket timeouts on CI
104103
connectTimeout.set(Duration.ofMinutes(3))
105104
clientTimeout.set(Duration.ofMinutes(3))
106105

@@ -129,7 +128,7 @@ subprojects {
129128

130129
scm {
131130
connection.set("scm:git:git://github.com/bozaro/git-lfs-java.git")
132-
tag.set(gitCommit)
131+
tag.set(Grgit.open(mapOf("dir" to rootDir)).head().id)
133132
url.set("https://github.com/bozaro/git-lfs-java")
134133
}
135134

@@ -157,19 +156,6 @@ subprojects {
157156
}
158157
}
159158
}
160-
161-
val secretKeyRingFile = "${rootProject.projectDir}/secring.gpg"
162-
extra["signing.secretKeyRingFile"] = secretKeyRingFile
163-
extra["signing.keyId"] = "4B49488E"
164-
extra["signing.password"] = signingPassword
165-
166-
configure<SigningExtension> {
167-
isRequired = signingPassword != null && file(secretKeyRingFile).exists() && !project.version.toString().endsWith("-SNAPSHOT")
168-
169-
// TODO: Is it possible to access publishing extension in a safer way?
170-
val publishing: PublishingExtension by project.extensions
171-
sign(publishing.publications)
172-
}
173159
}
174160

175161
tasks.closeRepository.configure {

secring.gpg.enc

-2.53 KB
Binary file not shown.

0 commit comments

Comments
 (0)