1.9.2 Hotfix #313
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: SpaceWarp Builder | |
on: | |
push: | |
branches: [ "main", "dev" ] | |
pull_request: | |
branches: [ "main", "dev" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Download NuGet | |
id: download-nuget | |
run: | | |
sudo curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe | |
- name: Running automated tests | |
run: | | |
dotnet test "SpaceWarp.sln" | |
test_exit_code=$? | |
if [ $test_exit_code -ne 0 ]; then | |
echo "Tests failed. Cancelling the build." | |
exit $test_exit_code | |
fi | |
- name: Build the solution | |
run: dotnet build "SpaceWarp.sln" -c Release | |
- name: Find zip | |
id: find-zip | |
run: | | |
echo "zip=$(ls -1 dist/SpaceWarp-*.zip | head -n 1)" >> $GITHUB_ENV | |
echo "artifact_name=SpaceWarpRelease" >> $GITHUB_ENV | |
- name: Upload release zip | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.artifact_name }} | |
path: ${{ env.zip }} | |
- name: Find NuGet package | |
id: find-nupkg | |
run: | | |
echo "nupkg=$(ls -1 nuget/SpaceWarp.*.nupkg | head -n 1)" >> $GITHUB_ENV | |
echo "artifact_name=SpaceWarpNuGet" >> $GITHUB_ENV | |
- name: Upload NuGet package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.artifact_name }} | |
path: ${{ env.nupkg }} |