-
Notifications
You must be signed in to change notification settings - Fork 2
36 lines (28 loc) · 1.13 KB
/
ci.yml
File metadata and controls
36 lines (28 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Build Test Publish
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
- name: Test
env:
GRAPHQLSHARP_SHOP_ID: ${{ secrets.GRAPHQLSHARP_SHOP_ID }}
GRAPHQLSHARP_SHOP_TOKEN: ${{ secrets.GRAPHQLSHARP_SHOP_TOKEN }}
run: dotnet test --no-restore --verbosity normal
- name: Publish to nuget
if: github.event_name == 'workflow_dispatch' # Only runs when manually triggered for deployment
run: dotnet nuget push GraphQLSharp/bin/Release/*.nupkg -s https://api.nuget.org/v3/index.json --skip-duplicate -k "${{ secrets.NUGET_API_KEY }}"