Skip to content

Commit

Permalink
Switch from using Travis to GitHub Actions for release (#3434)
Browse files Browse the repository at this point in the history
  • Loading branch information
rnorth committed Jul 8, 2021
1 parent adae983 commit 5d87f61
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 70 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release

on:
release:
types: [published]

env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

jobs:
release:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '1.8'
- name: Clear existing docker image cache
run: docker image prune -af

- name: Run Gradle Build
run: ./gradlew build --scan --no-daemon -i

- name: Run Gradle Publish
run: |
./gradlew publish \
-Pversion="${{github.event.release.tag_name}}" --scan --no-daemon -i
env:
OSSRH_USERNAME: ${{secrets.OSSRH_USERNAME}}
OSSRH_PASSWORD: ${{secrets.OSSRH_PASSWORD}}
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

> 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.
[![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)

![Testcontainers logo](docs/logo.png)

# [Read the documentation here](http://www.testcontainers.org)
Expand Down
16 changes: 0 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
id 'io.franzbecker.gradle-lombok' version '4.0.0'
id 'com.github.johnrengelman.shadow' version '7.0.0'
id "com.jfrog.bintray" version "1.8.4" apply false
}

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

repositories {
jcenter()
mavenCentral()
}

Expand Down Expand Up @@ -48,20 +46,6 @@ subprojects {
// specific modules should be excluded from publication
if ( ! ["test-support", "jdbc-test"].contains(it.name) && !it.path.startsWith(":docs:") && it != project(":docs") ) {
apply from: "$rootDir/gradle/publishing.gradle"
apply from: "$rootDir/gradle/bintray.gradle"

jar.archiveClassifier.set("original")

publishing {
publications {
mavenJava(MavenPublication) { publication ->
artifacts.removeAll { it.classifier == jar.archiveClassifier.get() }
artifact project.tasks.shadowJar
}
}
}

task release(dependsOn: bintrayUpload)
}

test {
Expand Down
24 changes: 0 additions & 24 deletions gradle/bintray.gradle

This file was deleted.

21 changes: 17 additions & 4 deletions gradle/publishing.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
apply plugin: 'maven-publish'

task sourceJar(type: Jar) {
classifier = 'sources'
archiveClassifier.set( 'sources')
from sourceSets.main.allJava
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
archiveClassifier.set('javadoc')
from javadoc
}

jar.archiveClassifier.set("original")

publishing {
publications {
mavenJava(MavenPublication) { publication ->
artifactId = project.name

artifact project.tasks.jar
artifact sourceJar
artifact javadocJar

artifact project.tasks.jar
artifacts.removeAll { it.classifier == jar.archiveClassifier.get() }
artifact project.tasks.shadowJar

pom.withXml {
def rootNode = asNode()
rootNode.children().last() + {
Expand Down Expand Up @@ -77,4 +81,13 @@ publishing {
}
}
}
repositories {
maven {
url("https://oss.sonatype.org/service/local/staging/deploy/maven2")
credentials {
username = System.getenv("OSSRH_USERNAME")
password = System.getenv("OSSRH_PASSWORD")
}
}
}
}

0 comments on commit 5d87f61

Please sign in to comment.