Skip to content

Commit ca722f0

Browse files
authored
chore: migrate to GitHub Actions (#108)
1 parent eaed272 commit ca722f0

File tree

4 files changed

+93
-28
lines changed

4 files changed

+93
-28
lines changed

.github/workflows/release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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: 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+
env:
25+
FrameworkPathOverride: /usr/lib/mono/4.5/
26+
27+
notify-on-failure:
28+
name: Slack notify on failure
29+
if: ${{ failure() }}
30+
needs: [ release ]
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: rtCamp/action-slack-notify@v2
34+
env:
35+
SLACK_COLOR: 'danger'
36+
SLACK_ICON_EMOJI: ':github:'
37+
SLACK_MESSAGE: ${{ format('Failed to release {1}{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }}
38+
SLACK_TITLE: Release Failure
39+
SLACK_USERNAME: GitHub Actions
40+
SLACK_MSG_AUTHOR: twilio-dx
41+
SLACK_FOOTER: Posted automatically using GitHub Actions
42+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
43+
MSG_MINIMAL: true

.github/workflows/test.yml

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