-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.41 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
name: Continuous Integration
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
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: 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 --source https://nuget.pkg.github.com/sliekens/index.json --api-key ${{secrets.GITHUB_TOKEN}}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}