-
Notifications
You must be signed in to change notification settings - Fork 8
53 lines (42 loc) · 1.78 KB
/
Copy pathbuild-and-publish_12.3.yml
File metadata and controls
53 lines (42 loc) · 1.78 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Build and Publish 12.3
run-name: Version 12.3.${{ github.run_number }} (${{ github.event.head_commit.message }})
on:
push:
branches:
- develop
permissions:
packages: write
env:
MAJOR: 12
MINOR: 3
RUN: ${{ github.run_number }}
jobs:
build-test-publish:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Restore dependencies
run: |
nuget sources add -username Open-Systems-Pharmacology -password ${{ secrets.GITHUB_TOKEN }} -name OSP-GitHub-Packages -source "https://nuget.pkg.github.com/Open-Systems-Pharmacology/index.json"
dotnet restore
- name: define env variables
run: |
echo "APP_VERSION=${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.RUN }}" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Build
run: dotnet build OSPSuite.Core.sln /p:Version=${{env.APP_VERSION}}
- name : Test
run: dotnet test .\tests\**\bin\Debug\net472\OSPSuite*Tests.dll -v normal --no-build --logger:"html;LogFileName=../testLog_Windows.html"
- name: Pack the project
run: dotnet pack .\OSPSuite.Core.sln --no-build --no-restore -o ./ -p:PackageVersion=${{env.APP_VERSION}} --configuration=Debug --no-build
- name: Push test log as artifact
uses: actions/upload-artifact@v4
with:
name: testLog_Windows
path: ./testLog*.html
- name: Publish to GitHub registry
# if it is a merge to default branch
if: github.event_name == 'push' && github.ref_name == github.event.repository.default_branch
run: dotnet nuget push *.nupkg --source https://nuget.pkg.github.com/${{github.repository_owner}}/index.json --api-key ${{ secrets.GITHUB_TOKEN }}