-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: migrate to GitHub Actions (#1142)
- Loading branch information
1 parent
b7cb4f0
commit 6169c51
Showing
8 changed files
with
94 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sendgrid-csharp | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup .NET Core SDK | ||
uses: actions/[email protected] | ||
with: | ||
dotnet-version: '3.1.x' | ||
|
||
- name: Publish package to NuGet | ||
run: | | ||
make release | ||
dotnet nuget push **/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate | ||
notify-on-failure: | ||
name: Slack notify on failure | ||
if: ${{ failure() }} | ||
needs: [ release ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_COLOR: 'danger' | ||
SLACK_ICON_EMOJI: ':github:' | ||
SLACK_MESSAGE: ${{ format('Failed to release {1}{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }} | ||
SLACK_TITLE: Release Failure | ||
SLACK_USERNAME: GitHub Actions | ||
SLACK_MSG_AUTHOR: twilio-dx | ||
SLACK_FOOTER: Posted automatically using GitHub Actions | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
MSG_MINIMAL: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Tests | ||
on: | ||
push: | ||
branches: [ '*' ] | ||
pull_request: | ||
branches: [ main ] | ||
schedule: | ||
# Run automatically at 8AM PST Monday-Friday | ||
- cron: '0 15 * * 1-5' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
tests: | ||
name: Run Tests | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
steps: | ||
- name: Checkout sendgrid-csharp | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup .NET Core SDK | ||
uses: actions/[email protected] | ||
with: | ||
dotnet-version: '3.1.x' | ||
|
||
- run: dotnet build -c Release | ||
- name: Build & Test | ||
run: make test-docker release | ||
- run: bash <(curl -s https://codecov.io/bash) | ||
|
||
notify-on-failure: | ||
name: Slack notify on failure | ||
if: ${{ failure() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }} | ||
needs: [ tests ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_COLOR: 'danger' | ||
SLACK_ICON_EMOJI: ':github:' | ||
SLACK_MESSAGE: ${{ format('Failed running build on {1}{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }} | ||
SLACK_TITLE: Build Failure | ||
SLACK_USERNAME: GitHub Actions | ||
SLACK_MSG_AUTHOR: twilio-dx | ||
SLACK_FOOTER: Posted automatically using GitHub Actions | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
MSG_MINIMAL: true |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters