This repository was archived by the owner on Aug 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
68 lines (64 loc) · 2.61 KB
/
Copy pathcibuild.yml
File metadata and controls
68 lines (64 loc) · 2.61 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: CI Build
on:
pull_request:
push:
paths:
- "src/**"
- ".github/workflows/**"
- "scripts/**"
# To avoid vendor lock-in, this is mostly driven by a build script
jobs:
build-linux: # Sanity check build
name: Linux
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Run build script
shell: pwsh
run: |
$Env:GIT_BRANCH=$Env:GITHUB_REF
$Env:build_artifactsDir=$Env:RUNNER_TEMP
cd scripts
./build.ps1
Get-ChildItem Env: | Where-Object {$_.Name -Match "^MH_"} | %{ echo "::set-output name=$($_.Name)::$($_.Value)" }
build: # Actual prod build
name: Windows
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
# To avoid vendor lock-in, this is mostly driven by a build script
- name: Run build script
id: pwshbuild
shell: pwsh
run: |
$Env:GIT_BRANCH=$Env:GITHUB_REF
$Env:build_artifactsDir=$Env:RUNNER_TEMP
cd scripts
./build.ps1
Get-ChildItem Env: | Where-Object {$_.Name -Match "^MH_"} | %{ echo "::set-output name=$($_.Name)::$($_.Value)" }
- name: Publish to GPR (Development)
if: success() && !startsWith(github.ref, 'refs/pull') && steps.pwshbuild.outputs.MH_IS_PROD_BUILD == 'False'
shell: pwsh
run: |
$mhPath = "${{ steps.pwshbuild.outputs.MH_BUILD_OUTPUT }}"
$nupkgName = "simplexcel.${{ steps.pwshbuild.outputs.MH_BUILD_VERSION_PACKAGE }}.nupkg"
$nupkgPath = Join-Path -Path $mhPath -ChildPath $nupkgName
# Publish to GitHub Package Repository
Write-Host "Dev build, pushing to GPR: $nupkgPath"
dotnet nuget push "$nupkgPath" --source https://nuget.pkg.github.com/mstum --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate --no-symbols
- name: Publish to Nuget.org (Release)
if: success() && steps.pwshbuild.outputs.MH_IS_PROD_BUILD == 'True'
shell: pwsh
run: |
$mhPath = "${{ steps.pwshbuild.outputs.MH_BUILD_OUTPUT }}"
$nupkgName = "simplexcel.${{ steps.pwshbuild.outputs.MH_BUILD_VERSION_PACKAGE }}.nupkg"
$nupkgPath = Join-Path -Path $mhPath -ChildPath $nupkgName
# Publish to Nuget.org
Write-Host "Release build, pushing to Nuget.org: $nupkgPath"
dotnet nuget push "$nupkgPath" -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --no-symbols