Merge pull request #64 from sillsdev/FileUpdate-should-not-fail-if-li… #28
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: "Build, Test and Pack" | |
on: | |
push: | |
branches: [ master ] | |
# Trigger on release tags | |
tags: [ 'v[0-9]+*' ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
event_file: | |
name: "Event File" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Upload | |
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 | |
with: | |
name: Event File | |
path: ${{ github.event_path }} | |
build-and-test: | |
name: "Build and Test" | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 | |
with: | |
fetch-depth: '0' | |
- name: Install .NET Core | |
uses: actions/setup-dotnet@c0d4ad69d8bd405d234f1c9166d383b7a4f69ed8 # v2.1.0 | |
with: | |
dotnet-version: 6.0.x | |
- name: Set up Visual Studio shell | |
uses: egor-tensin/vs-shell@9a932a62d05192eae18ca370155cf877eecc2202 # v2 | |
if: matrix.os == 'windows-latest' | |
- name: Build and pack Dogfood | |
run: | | |
mkdir SIL.ReleaseTasks.Dogfood/bin | |
mkdir SIL.ReleaseTasks.Dogfood/bin/Release | |
dotnet pack --configuration Release SIL.ReleaseTasks.Dogfood/SIL.ReleaseTasks.Dogfood.csproj | |
- name: Build | |
run: dotnet build --configuration Release | |
- name: Test | |
run: dotnet test --configuration Release --no-build -- NUnit.TestOutputXml=TestResults | |
- name: Upload Test Results | |
if: always() | |
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 | |
with: | |
name: Test Results (${{matrix.os}}) | |
path: "**/TestResults/*.xml" | |
- name: Pack | |
run: dotnet pack --configuration Release --no-build --include-symbols | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 | |
with: | |
name: sil-buildtasks-nugetpackages | |
path: | | |
output/**/*.nupkg | |
output/**/*.snupkg | |
if: matrix.os == 'ubuntu-latest' | |
publish-nuget: | |
name: "Publish NuGet package" | |
runs-on: ubuntu-latest | |
needs: build-and-test | |
if: github.event_name == 'push' | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v3.0.0 | |
with: | |
path: artifacts | |
- name: Publish to Nuget | |
run: dotnet nuget push artifacts/*/Release/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.SILLSDEV_PUBLISH_NUGET_ORG}} --skip-duplicate |