Skip to content

Commit 2e10229

Browse files
committed
chore: migrate to github actions
1 parent f6b666c commit 2e10229

6 files changed

Lines changed: 102 additions & 65 deletions

File tree

.github/workflows/release.yml

Lines changed: 50 additions & 0 deletions
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

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
- name: Checkout twilio-java
22+
uses: actions/checkout@v2
23+
24+
- name: Set up Java
25+
uses: actions/setup-java@v2
26+
with:
27+
distribution: 'temurin'
28+
java-version: ${{ matrix.java }}
29+
cache: 'maven'
30+
31+
- run: mvn install -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -B -V
32+
- name: Run Unit Tests
33+
run: make test-docker
34+
35+
notify-on-failure:
36+
name: Slack notify on failure
37+
if: ${{ failure() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
38+
needs: [test]
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: rtCamp/action-slack-notify@v2
42+
env:
43+
SLACK_COLOR: ${{ needs.test.status }}
44+
SLACK_ICON_EMOJI: ':github:'
45+
SLACK_MESSAGE: ${{ format('Build {2} in {1} failed{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }}
46+
SLACK_TITLE: Build Failure
47+
SLACK_USERNAME: GitHub Actions
48+
SLACK_MSG_AUTHOR: twilio-dx
49+
SLACK_FOOTER: Posted automatically using GitHub Actions
50+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
51+
MSG_MINIMAL: true

.maven.xml

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

.travis.yml

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![SendGrid Logo](twilio_sendgrid_logo.png)
22

3-
[![Travis Badge](https://travis-ci.com/sendgrid/sendgrid-java.svg?branch=main)](https://travis-ci.com/sendgrid/sendgrid-java)
3+
[![BuildStatus](https://github.com/sendgrid/sendgrid-java/actions/workflows/test.yml/badge.svg)](https://github.com/sendgrid/sendgrid-java/actions/workflows/test.yml)
44
[![Maven Central](https://img.shields.io/maven-central/v/com.sendgrid/sendgrid-java.svg)](http://mvnrepository.com/artifact/com.sendgrid/sendgrid-java)
55
[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)
66
[![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/sendgrid-java.svg)](https://github.com/sendgrid/sendgrid-java/graphs/contributors)

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ public void checkGitIgnoreExists() {
2525
assertTrue(new File("./.gitignore").exists());
2626
}
2727

28-
// ./.travis.yml
29-
@Test
30-
public void checkTravisExists() {
31-
assertTrue(new File("./.travis.yml").exists());
32-
}
33-
3428
// ./.codeclimate.yml
3529
@Test
3630
public void checkCodeClimateExists() {

0 commit comments

Comments
 (0)