Skip to content

NuGet packing with Mono and nuget.exe #191

NuGet packing with Mono and nuget.exe

NuGet packing with Mono and nuget.exe #191

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: Install Mono
id: install-mono
run: |
apt-get install ca-certificates gnupg
gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mono-official-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb [signed-by=/usr/share/keyrings/mono-official-archive-keyring.gpg] https://download.mono-project.com/repo/ubuntu stable-focal main" | tee /etc/apt/sources.list.d/mono-official-stable.list
apt-get update
apt install mono-devel -y
- name: Download NuGet
id: download-nuget
run: |
curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
- 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 }}