Skip to content

Commit c6113f5

Browse files
committed
chore: migrate to GitHub Actions
1 parent 46b0bdc commit c6113f5

File tree

4 files changed

+89
-22
lines changed

4 files changed

+89
-22
lines changed

.github/workflows/deploy.yml

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

.github/workflows/test.yml

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

.travis.yml

Lines changed: 0 additions & 21 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/csharp-http-client.svg?branch=main)](https://travis-ci.com/sendgrid/csharp-http-client)
3+
[![BuildStatus](https://github.com/sendgrid/csharp-http-client/actions/workflows/test.yml/badge.svg)](https://github.com/sendgrid/csharp-http-client/actions/workflows/test.yml)
44
[![NuGet](https://img.shields.io/nuget/v/SendGrid.CSharp.Http.Client.svg)](https://www.nuget.org/packages/SendGrid.CSharp.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)

0 commit comments

Comments
 (0)