Allow overriding hg.exe location with env vars #71
Workflow file for this run
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 ] | |
tags: [ v* ] | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
event_file: | |
name: "Event File" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Event File | |
path: ${{ github.event_path }} | |
build-and-test: | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 360 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }} | |
cancel-in-progress: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 | |
with: | |
fetch-depth: 0 # fetch full history for GitVersion | |
- name: Setup .NET | |
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0 | |
with: | |
dotnet-version: | | |
6.0.x | |
8.0.x | |
- name: Restore | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore -c Release | |
- name: Install python2 for test execution | |
run: sudo apt-get install python2 | |
if: matrix.os == 'ubuntu-latest' | |
# Unfortunately we need two test steps because we need different filters. | |
# We could conditionally set an environment variable, but unfortunately | |
# the syntax to access that is different on Windows vs Linux. | |
- name: Test on Linux | |
run: dotnet test --no-build -c Release --filter TestCategory!=RequiresUI -- NUnit.TestOutputXml=TestResults | |
if: matrix.os == 'ubuntu-latest' | |
- name: Test on Windows | |
run: dotnet test --no-build -c Release --filter TestCategory!=SkipOnBuildServer -- NUnit.TestOutputXml=TestResults | |
if: matrix.os == 'windows-latest' | |
- name: Upload Test Results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Test Results (${{matrix.os}}) | |
path: "**/TestResults/*.xml" | |
- name: Checkout Chorus Help # required for Chorus Merge Module | |
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 | |
with: | |
repository: sillsdev/chorushelp | |
path: DistFiles/Help | |
if: matrix.os == 'windows-latest' | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@34cfbaee7f672c76950673338facd8a73f637506 # v1.1.3 | |
if: matrix.os == 'windows-latest' | |
# ChorusMergeModule.msm is used by FieldWorks, FLExBridge, and possibly WeSay installers (as of 2022.12). | |
# CMM must be built after tests have been run, since the fixutf8.pyc files are generated only when the .py files are run. | |
- name: Build Merge Module | |
run: msbuild src/Installer/ChorusMergeModule.wixproj | |
if: matrix.os == 'windows-latest' | |
- name: Pack Merge Module | |
run: msbuild src/Installer/ChorusMergeModule.wixproj -t:pack | |
if: matrix.os == 'windows-latest' | |
- name: Upload Merge Module | |
uses: actions/upload-artifact@v4 | |
with: | |
name: chorus-merge-module | |
path: | | |
output/Release/*.msm | |
output/*.nupkg | |
if: matrix.os == 'windows-latest' | |
- name: Build Chorus Hub Installer | |
run: | | |
msbuild src/Installer/ChorusHub.wixproj /t:Restore | |
msbuild src/Installer/ChorusHub.wixproj /t:StampLicenseYear | |
msbuild src/Installer/ChorusHub.wixproj /t:Build | |
if: matrix.os == 'windows-latest' | |
- name: Upload Chorus Hub Installer | |
uses: actions/upload-artifact@v4 | |
with: | |
name: chorus-hub-installer | |
path: | | |
output/Release/*.msi | |
if: matrix.os == 'windows-latest' | |
- name: Pack | |
run: dotnet pack --no-restore --no-build -c Release | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: chorus-dotnet-nugetpackage | |
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@v4 | |
with: | |
path: artifacts | |
- name: Publish to Nuget | |
run: dotnet nuget push artifacts/**/*.*nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.SILLSDEV_PUBLISH_NUGET_ORG}} --skip-duplicate |