-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (42 loc) · 1.54 KB
/
continuous_integration.yml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Continuous Integration
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout Code
uses: actions/checkout@v3
with:
submodules: true # Fetch and checkout submodules
fetch-depth: 0 # Ensure the full history is fetched, useful when dealing with submodules
- name: 💉 Install dependencies
run: dotnet restore
- name: 🛠️ Build
run: dotnet build --configuration Release --no-restore
- name: ✅ Test
run: dotnet test --no-restore --verbosity normal
- name: 📦 Package NuGet
run: dotnet pack --no-build --configuration Release
- name: 📤 Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: nupkg
path: Guppi.Console/nupkg/*.nupkg
publish:
runs-on: ubuntu-latest
needs: build
# only push nuget package for PRs merged to master
if: github.ref == 'refs/heads/main'
steps:
- name: 📥 Download Artifacts
uses: actions/download-artifact@v3
with:
name: nupkg
- name: 🔑 Authenticate to GitHub Packages
run: dotnet nuget add source --username rprouse --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/rprouse/index.json"
- name: 📤 Publish NuGet to GitHub Packages
run: dotnet nuget push "**/dotnet-guppi.*.nupkg" -k ${{ secrets.GITHUB_TOKEN }} --source "github" --skip-duplicate --no-symbols