-
Notifications
You must be signed in to change notification settings - Fork 51
68 lines (57 loc) · 1.77 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
57
58
59
60
61
62
63
64
65
66
67
68
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
release:
types:
- published
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- name: Set Build Version
run: |
$versionDate = Get-Date -Format "yyyy.MM.dd"
$versionPrefix = "$($versionDate).$($Env:GITHUB_RUN_NUMBER)"
$versionSuffix = ""
If ($Env:GITHUB_EVENT_NAME -eq "push")
{
$versionSuffix = "pre"
}
Write-Host "Version $($versionPrefix) $($versionSuffix)"
echo "VERSIONPREFIX=$versionPrefix" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
echo "VERSIONSUFFIX=$versionSuffix" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
shell: pwsh
- name: Build
run: dotnet build XSharp.sln
- name: Test
run: dotnet test tests/XSharp.Tests/XSharp.Tests.csproj --no-build
- name: Pack
run: dotnet pack XSharp.sln --include-symbols
- name: Upload Nupkg Artifacts
uses: actions/[email protected]
with:
name: nupkg
path: artifacts\Debug\nupkg\*.nupkg
- name: Upload Vsix Artifacts
uses: actions/[email protected]
with:
name: vsix
path: artifacts\Debug\VSIX\*.vsix
publish:
runs-on: windows-latest
needs: build
if: ${{ github.event_name == 'push' || github.event_name == 'release' }}
steps:
- uses: actions/[email protected]
- name: Nuget
run: dotnet nuget push **/*.nupkg --source "https://nuget.pkg.github.com/CosmosOS/index.json" --api-key "${{ secrets.GITHUB_TOKEN }}" --skip-duplicate