Skip to content

Commit f417a76

Browse files
committed
chore: migrate to GitHub Actions
1 parent eaed272 commit f417a76

File tree

4 files changed

+87
-28
lines changed

4 files changed

+87
-28
lines changed

.github/workflows/deploy.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Deploy
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
workflow_dispatch:
7+
8+
jobs:
9+
deploy:
10+
name: Deploy
11+
runs-on: ubuntu-latest
12+
steps:
13+
uses: actions/checkout@v2
14+
15+
- name: Setup .NET Core SDK
16+
uses: actions/setup-dotnet@v1.8.2
17+
with:
18+
dotnet-version: '3.1.x'
19+
20+
- name: Publish package to NuGet
21+
run: |
22+
make install release
23+
dotnet nuget push **/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
24+
25+
notify-on-failure:
26+
name: Slack notify on failure
27+
if: ${{ failure() }}
28+
needs: [ deploy ]
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: rtCamp/action-slack-notify@v2
32+
env:
33+
SLACK_COLOR: 'danger'
34+
SLACK_ICON_EMOJI: ':github:'
35+
SLACK_MESSAGE: ${{ format('Failed to deploy {1}{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }}
36+
SLACK_TITLE: Deployment Failure
37+
SLACK_USERNAME: GitHub Actions
38+
SLACK_MSG_AUTHOR: twilio-dx
39+
SLACK_FOOTER: Posted automatically using GitHub Actions
40+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
41+
MSG_MINIMAL: true

.github/workflows/test.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+
tests:
14+
name: Run Tests
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 20
17+
steps:
18+
uses: actions/checkout@v2
19+
20+
- name: Setup .NET Core SDK
21+
uses: actions/setup-dotnet@v1.8.2
22+
with:
23+
dotnet-version: '3.1.x'
24+
25+
- name: Build & Test
26+
run: make install test
27+
- run: bash <(curl -s https://codecov.io/bash)
28+
29+
notify-on-failure:
30+
name: Slack notify on failure
31+
if: ${{ failure() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
32+
needs: [ tests ]
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: rtCamp/action-slack-notify@v2
36+
env:
37+
SLACK_COLOR: 'danger'
38+
SLACK_ICON_EMOJI: ':github:'
39+
SLACK_MESSAGE: ${{ format('Failed running build on {1}{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }}
40+
SLACK_TITLE: Build Failure
41+
SLACK_USERNAME: GitHub Actions
42+
SLACK_MSG_AUTHOR: twilio-dx
43+
SLACK_FOOTER: Posted automatically using GitHub Actions
44+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
45+
MSG_MINIMAL: true

.travis.yml

Lines changed: 0 additions & 27 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/smtpapi-csharp.svg?branch=main)](https://travis-ci.com/sendgrid/smtpapi-csharp)
3+
[![Build Status](https://github.com/sendgrid/smtpapi-csharp/actions/workflows/test.yml/badge.svg)](https://github.com/sendgrid/smtpapi-csharp/actions/workflows/test.yml)
44
[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)
55
[![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/smtpapi-csharp.svg)](https://github.com/sendgrid/smtpapi-csharp/graphs/contributors)
66
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

0 commit comments

Comments
 (0)