This repository has been archived by the owner on Aug 26, 2022. It is now read-only.
Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Simplexcel/.github/workflows/cibuild.yml
View runs Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
68 lines (64 sloc)
2.61 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |