Skip to content

Commit daf26f6

Browse files
author
Dai MIKURUBE
committed
Test and publish from GitHub Actions
1 parent 3ea8ce8 commit daf26f6

File tree

5 files changed

+57
-6
lines changed

5 files changed

+57
-6
lines changed

.github/workflows/check.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Check
2+
on: [ pull_request, push ]
3+
jobs:
4+
check:
5+
runs-on: ubuntu-latest
6+
# push: always run.
7+
# pull_request: run only when the PR is submitted from a forked repository, not within this repository.
8+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
9+
strategy:
10+
fail-fast: false
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Set up OpenJDK 8
14+
uses: actions/setup-java@v2
15+
with:
16+
java-version: 8
17+
distribution: "temurin"
18+
cache: "gradle"
19+
- name: Check
20+
run: ./gradlew --stacktrace check

.github/workflows/publish.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish
2+
on:
3+
push:
4+
tags:
5+
- "v1.*"
6+
jobs:
7+
publish:
8+
environment:
9+
name: maven-central-and-ruby-gems
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: true
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up OpenJDK 8
16+
uses: actions/setup-java@v2
17+
with:
18+
java-version: 8
19+
distribution: "temurin"
20+
- name: Publish
21+
run: |
22+
mkdir -p $HOME/.gem
23+
touch $HOME/.gem/credentials
24+
chmod 0600 $HOME/.gem/credentials
25+
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials
26+
./gradlew --stacktrace publishMavenPublicationToMavenCentralRepository gemPush
27+
env:
28+
ORG_GRADLE_PROJECT_ossrhUsername: embulk
29+
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }}
30+
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY_ARMOR }}
31+
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PRIVATE_KEY_PASSWORD }}
32+
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}

build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ gemPush {
258258
}
259259

260260
test {
261-
useJUnitPlatform()
262261
testLogging {
263262
events "passed", "skipped", "failed", "standardOut", "standardError"
264263
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL

src/main/java/org/embulk/output/s3/HttpProxy.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@
1616

1717
package org.embulk.output.s3;
1818

19-
19+
import java.util.Optional;
2020
import org.embulk.util.config.Config;
2121
import org.embulk.util.config.ConfigDefault;
2222
import org.embulk.util.config.Task;
2323

24-
import java.util.Optional;
25-
2624
/**
2725
* HttpProxy is config unit for Input/Output plugins' configs.
2826
*

src/main/java/org/embulk/output/s3/S3FileOutputPlugin.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ private ClientConfiguration getClientConfiguration(PluginTask task)
201201
configSource.set("host", task.getProxyHost().get());
202202
HttpProxy httpProxy = configMapper.map(configSource, HttpProxy.class);
203203
task.setHttpProxy(Optional.of(httpProxy));
204-
} else {
204+
}
205+
else {
205206
HttpProxy httpProxy = task.getHttpProxy().get();
206207
if (httpProxy.getHost().isEmpty()) {
207208
httpProxy.setHost(task.getProxyHost().get());
@@ -226,7 +227,8 @@ private ClientConfiguration getClientConfiguration(PluginTask task)
226227
return clientConfig;
227228
}
228229

229-
private void setHttpProxyInAwsClient(ClientConfiguration clientConfig, HttpProxy httpProxy) {
230+
private void setHttpProxyInAwsClient(ClientConfiguration clientConfig, HttpProxy httpProxy)
231+
{
230232
// host
231233
clientConfig.setProxyHost(httpProxy.getHost());
232234

0 commit comments

Comments
 (0)