Skip to content

Commit 338e565

Browse files
authored
chore: migrate to github actions (#133)
1 parent b439169 commit 338e565

File tree

7 files changed

+101
-150
lines changed

7 files changed

+101
-150
lines changed

.codeclimate.yml

-88
This file was deleted.

.github/workflows/release.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
workflow_dispatch:
7+
8+
jobs:
9+
release:
10+
name: Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Set up Sonatype Maven
16+
uses: actions/setup-java@v2
17+
with:
18+
java-version: 8
19+
distribution: temurin
20+
server-id: ossrh
21+
server-username: MAVEN_USERNAME
22+
server-password: MAVEN_PASSWORD
23+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
24+
gpg-passphrase: GPG_PASSPHRASE
25+
26+
- run: mvn install -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -B -V
27+
- name: Publish to Maven
28+
env:
29+
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
30+
MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
31+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
32+
run: mvn clean deploy -DskipTests=true -B -U -Prelease
33+
34+
notify-on-failure:
35+
name: Slack notify on failure
36+
if: ${{ failure() }}
37+
needs: [release]
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: rtCamp/action-slack-notify@v2
41+
env:
42+
SLACK_COLOR: 'danger'
43+
SLACK_ICON_EMOJI: ':github:'
44+
SLACK_MESSAGE: ${{ format('Failed to release {1}{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }}
45+
SLACK_TITLE: Release Failure
46+
SLACK_USERNAME: GitHub Actions
47+
SLACK_MSG_AUTHOR: twilio-dx
48+
SLACK_FOOTER: Posted automatically using GitHub Actions
49+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
50+
MSG_MINIMAL: true

.github/workflows/test.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Tests
2+
on:
3+
push:
4+
branches: [ '*' ]
5+
pull_request:
6+
branches: [ main ]
7+
schedule:
8+
# Run automatically at 8AM PST Monday-Friday
9+
- cron: '0 15 * * 1-5'
10+
workflow_dispatch:
11+
12+
jobs:
13+
test:
14+
name: Test
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 20
17+
strategy:
18+
matrix:
19+
java: [8, 11]
20+
steps:
21+
- uses: actions/checkout@v2
22+
23+
- name: Set up Java
24+
uses: actions/setup-java@v2
25+
with:
26+
distribution: 'temurin'
27+
java-version: ${{ matrix.java }}
28+
cache: 'maven'
29+
30+
- run: mvn install -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -B -V
31+
- name: Run Unit Tests
32+
run: mvn test -B
33+
34+
notify-on-failure:
35+
name: Slack notify on failure
36+
if: ${{ failure() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
37+
needs: [test]
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: rtCamp/action-slack-notify@v2
41+
env:
42+
SLACK_COLOR: ${{ needs.test.status }}
43+
SLACK_ICON_EMOJI: ':github:'
44+
SLACK_MESSAGE: ${{ format('Build {2} in {1} failed{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }}
45+
SLACK_TITLE: Build Failure
46+
SLACK_USERNAME: GitHub Actions
47+
SLACK_MSG_AUTHOR: twilio-dx
48+
SLACK_FOOTER: Posted automatically using GitHub Actions
49+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
50+
MSG_MINIMAL: true

.maven.xml

-24
This file was deleted.

.travis.yml

-28
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![SendGrid Logo](twilio_sendgrid_logo.png)
22

3-
[![Build Status](https://travis-ci.com/sendgrid/java-http-client.svg?branch=main)](https://travis-ci.com/sendgrid/java-http-client)
3+
[![BuildStatus](https://github.com/sendgrid/java-http-client/actions/workflows/test.yml/badge.svg)](https://github.com/sendgrid/java-http-client/actions/workflows/test.yml)
44
[![Maven Central](https://img.shields.io/maven-central/v/com.sendgrid/java-http-client.svg)](http://mvnrepository.com/artifact/com.sendgrid/java-http-client)
55
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
66
[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)

src/test/java/com/sendgrid/TestRequiredFilesExist.java

-9
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@ public class TestRequiredFilesExist {
2929
assertTrue(new File("./.gitignore").exists());
3030
}
3131

32-
// ./.travis.yml
33-
@Test public void checkTravisExists() {
34-
assertTrue(new File("./.travis.yml").exists());
35-
}
36-
37-
// ./.codeclimate.yml
38-
@Test public void checkCodeClimateExists() {
39-
assertTrue(new File("./.codeclimate.yml").exists());
40-
}
4132

4233
// ./CHANGELOG.md
4334
@Test public void checkChangelogExists() {

0 commit comments

Comments
 (0)