Skip to content

Commit 2c180de

Browse files
AoshiWAoshiW
authored andcommitted
add workflows
1 parent cda93a8 commit 2c180de

File tree

3 files changed

+75
-0
lines changed

3 files changed

+75
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Check TwitchLib.EventSub.Webhooks PR Build Status
2+
3+
on:
4+
pull_request:
5+
branches: [ dev, main ]
6+
7+
jobs:
8+
check-buildstatus:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Setup .NET
15+
uses: actions/setup-dotnet@v3
16+
with:
17+
dotnet-version: 8.0.x
18+
- name: Restore dependencies
19+
run: dotnet restore
20+
- name: Build TwitchLib.EventSub.Webhooks
21+
run: dotnet build --no-restore
22+
- name: Test TwitchLib.EventSub.Webhooks
23+
run: dotnet test --no-build --verbosity normal
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release Preview Nuget Package
2+
3+
on:
4+
push:
5+
branches: [ dev ]
6+
7+
jobs:
8+
release-preview:
9+
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: benjlevesque/[email protected]
15+
id: short-sha
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v3
18+
with:
19+
dotnet-version: 8.0.x
20+
- name: Restore dependencies
21+
run: dotnet restore
22+
- name: Build TwitchLib.EventSub.Webhooks
23+
run: dotnet build -c Release --no-restore
24+
- name: Pack TwitchLib.EventSub.Webhooks
25+
run: dotnet pack ./TwitchLib.EventSub.Webhooks/TwitchLib.EventSub.Webhooks.csproj -v normal -c Release -o nugets --no-build --version-suffix "preview.${{ github.run_number }}.${{ steps.short-sha.outputs.sha }}"
26+
- name: Push to Nuget
27+
run: dotnet nuget push "./nugets/*.nupkg" -k ${{ secrets.API_NUGET_TOKEN }} -s https://api.nuget.org/v3/index.json

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release Nuget Package
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
release:
9+
if: "contains(toJSON(github.event.commits.*.message), '[Release]')"
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Setup .NET
15+
uses: actions/setup-dotnet@v3
16+
with:
17+
dotnet-version: 8.0.x
18+
- name: Restore dependencies
19+
run: dotnet restore
20+
- name: Build TwitchLib.EventSub.Webhooks
21+
run: dotnet build -c Release --no-restore
22+
- name: Pack TwitchLib.EventSub.Webhooks
23+
run: dotnet pack ./TwitchLib.EventSub.Webhooks/TwitchLib.EventSub.Webhooks.csproj -v normal -c Release -o nugets --no-build
24+
- name: Push to Nuget
25+
run: dotnet nuget push "./nugets/*.nupkg" -k ${{ secrets.API_NUGET_TOKEN }} -s https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)