Skip to content

Commit 5d87f61

Browse files
authored
Switch from using Travis to GitHub Actions for release (#3434)
1 parent adae983 commit 5d87f61

File tree

6 files changed

+48
-70
lines changed

6 files changed

+48
-70
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
9+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-18.04
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-java@v1
17+
with:
18+
java-version: '1.8'
19+
- name: Clear existing docker image cache
20+
run: docker image prune -af
21+
22+
- name: Run Gradle Build
23+
run: ./gradlew build --scan --no-daemon -i
24+
25+
- name: Run Gradle Publish
26+
run: |
27+
./gradlew publish \
28+
-Pversion="${{github.event.release.tag_name}}" --scan --no-daemon -i
29+
env:
30+
OSSRH_USERNAME: ${{secrets.OSSRH_USERNAME}}
31+
OSSRH_PASSWORD: ${{secrets.OSSRH_PASSWORD}}

.travis.yml

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

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
> Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
44
5-
[![Build Status](https://travis-ci.org/testcontainers/testcontainers-java.svg?branch=master)](https://travis-ci.org/testcontainers/testcontainers-java)[ ![Download](https://api.bintray.com/packages/testcontainers/releases/testcontainers/images/download.svg) ](https://bintray.com/testcontainers/releases/testcontainers/_latestVersion)
6-
75
![Testcontainers logo](docs/logo.png)
86

97
# [Read the documentation here](http://www.testcontainers.org)

build.gradle

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
plugins {
22
id 'io.franzbecker.gradle-lombok' version '4.0.0'
33
id 'com.github.johnrengelman.shadow' version '7.0.0'
4-
id "com.jfrog.bintray" version "1.8.4" apply false
54
}
65

76
apply from: "$rootDir/gradle/ci-support.gradle"
@@ -20,7 +19,6 @@ subprojects {
2019
compileTestJava.options.encoding = 'UTF-8'
2120

2221
repositories {
23-
jcenter()
2422
mavenCentral()
2523
}
2624

@@ -48,20 +46,6 @@ subprojects {
4846
// specific modules should be excluded from publication
4947
if ( ! ["test-support", "jdbc-test"].contains(it.name) && !it.path.startsWith(":docs:") && it != project(":docs") ) {
5048
apply from: "$rootDir/gradle/publishing.gradle"
51-
apply from: "$rootDir/gradle/bintray.gradle"
52-
53-
jar.archiveClassifier.set("original")
54-
55-
publishing {
56-
publications {
57-
mavenJava(MavenPublication) { publication ->
58-
artifacts.removeAll { it.classifier == jar.archiveClassifier.get() }
59-
artifact project.tasks.shadowJar
60-
}
61-
}
62-
}
63-
64-
task release(dependsOn: bintrayUpload)
6549
}
6650

6751
test {

gradle/bintray.gradle

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

gradle/publishing.gradle

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
apply plugin: 'maven-publish'
22

33
task sourceJar(type: Jar) {
4-
classifier = 'sources'
4+
archiveClassifier.set( 'sources')
55
from sourceSets.main.allJava
66
}
77

88
task javadocJar(type: Jar, dependsOn: javadoc) {
9-
classifier = 'javadoc'
9+
archiveClassifier.set('javadoc')
1010
from javadoc
1111
}
1212

13+
jar.archiveClassifier.set("original")
14+
1315
publishing {
1416
publications {
1517
mavenJava(MavenPublication) { publication ->
1618
artifactId = project.name
17-
18-
artifact project.tasks.jar
1919
artifact sourceJar
2020
artifact javadocJar
2121

22+
artifact project.tasks.jar
23+
artifacts.removeAll { it.classifier == jar.archiveClassifier.get() }
24+
artifact project.tasks.shadowJar
25+
2226
pom.withXml {
2327
def rootNode = asNode()
2428
rootNode.children().last() + {
@@ -77,4 +81,13 @@ publishing {
7781
}
7882
}
7983
}
84+
repositories {
85+
maven {
86+
url("https://oss.sonatype.org/service/local/staging/deploy/maven2")
87+
credentials {
88+
username = System.getenv("OSSRH_USERNAME")
89+
password = System.getenv("OSSRH_PASSWORD")
90+
}
91+
}
92+
}
8093
}

0 commit comments

Comments
 (0)