-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (54 loc) · 1.85 KB
/
ci.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
55
56
name: Continuous Integration
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
SYMBOL_PACKAGE: false
jobs:
build-and-deploy:
name: Build and deploy
env:
build-configuration: Release
runs-on: ubuntu-latest
container: ghcr.io/sliekens/gw2sdk/devcontainer:latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Configure GPR
run: dotnet nuget add source https://nuget.pkg.github.com/sliekens/index.json --name sliekens
- name: Configure GPR authentication
uses: actions/setup-dotnet@v3
with:
source-url: https://nuget.pkg.github.com/sliekens/index.json
dotnet-version: null
global-json-file: null
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Install dependencies
run: dotnet restore --locked-mode
- name: Test
run: dotnet test --no-restore --settings coverletArgs.runsettings
env:
ApiKeyBasic: ${{ secrets.API_TOKEN_BASIC }}
ApiKey: ${{ secrets.API_TOKEN_FULL }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
- name: Build
run: dotnet build --configuration ${{ env.build-configuration }} --no-restore
- name: Pack artifacts
run: dotnet pack --configuration ${{ env.build-configuration }} --no-build --output artifacts --version-suffix CI-$(date --utc '+%Y%m%d-%H%M%S')
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: packages
path: artifacts
- name: Upload packages to GitHub Packages
run: dotnet nuget push artifacts/*.nupkg --api-key ${{secrets.GITHUB_TOKEN}}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}