From ed4c5cdbe879867a37fc945e8bba628cfa15cbd2 Mon Sep 17 00:00:00 2001 From: Caelan Sayler Date: Fri, 13 May 2022 16:21:39 +0100 Subject: [PATCH] Add macos publish steps to build --- .github/workflows/build.yml | 64 +++++++++++++++++++++++++------------ Squirrel.sln | 3 ++ 2 files changed, 47 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f911c40f..b65c7a4c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,39 +1,63 @@ -name: Build Squirrel (Windows) +name: Build Squirrel on: [push, pull_request] jobs: - build: + build-windows: + name: Build Windows runs-on: windows-latest steps: - uses: actions/checkout@v2 - with: - fetch-depth: 0 +# with: +# fetch-depth: 0 - name: Setup .NET uses: actions/setup-dotnet@v1 with: dotnet-version: 6.0.* - source-url: https://nuget.pkg.github.com/Clowd/index.json - env: - NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: "Install NGBV" + - name: Install NGBV run: dotnet tool install --tool-path . nbgv - name: Build shell: pwsh run: .\build.ps1 - - name: Create NuGet Package - shell: pwsh - run: .\pack.ps1 +# - name: Create NuGet Package +# shell: pwsh +# run: .\pack.ps1 - name: Test run: dotnet test test\Squirrel.Tests.csproj -l "console;verbosity=detailed" - - name: "Upload Tools" +# - name: "Upload Tools" +# uses: actions/upload-artifact@v3 +# with: +# path: .\build\SquirrelTools*.zip +# if-no-files-found: error +# https://stackoverflow.com/questions/63817052/github-actions-run-step-only-for-certain-pull-request-base-branches +# - name: "Upload NuGet Package" +# uses: actions/upload-artifact@v3 +# with: +# path: .\build\Clowd.Squirrel*.nupkg +# if-no-files-found: error +# - name: Publish to GitHub Packages +# if: ${{ github.ref == 'ref/head/develop' }} +# run: dotnet nuget push .\build\Clowd.Squirrel*.nupkg + - name: Upload Windows Artifacts uses: actions/upload-artifact@v3 with: - path: .\build\SquirrelTools*.zip - if-no-files-found: error - - name: "Upload NuGet Package" + name: windows-tools + path: .\build\publish\* + build-macos: + name: Build OSX + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: Build SquirrelMac + run: | + dotnet publish -v minimal -c Release -r osx.10.12-x64 --self-contained=true ./src/Squirrel.CommandLine.OSX/Squirrel.CommandLine.OSX.csproj -o ./publish + mv ./publish/SquirrelMac ./publish/SquirrelMac-x64 + dotnet publish -v minimal -c Release -r osx.11.0-arm64 --self-contained=true ./src/Squirrel.CommandLine.OSX/Squirrel.CommandLine.OSX.csproj -o ./publish + mkdir ./bundle + lipo -create -output ./bundle/SquirrelMac ./publish/SquirrelMac ./publish/SquirrelMac-x64 + - name: Build UpdateMac + run: dotnet publish -v minimal -c Release -r osx.10.12-x64 --self-contained=true ./src/Update.OSX/Update.OSX.csproj -o ./bundle + - name: Upload MacOS Artifacts uses: actions/upload-artifact@v3 with: - path: .\build\Clowd.Squirrel*.nupkg - if-no-files-found: error - - name: Publish to GitHub Packages - if: ${{ github.ref == 'ref/head/develop' }} - run: dotnet nuget push .\build\Clowd.Squirrel*.nupkg + name: osx-tools + path: .\build\bundle\* + \ No newline at end of file diff --git a/Squirrel.sln b/Squirrel.sln index 3e124ed0..98535ed2 100644 --- a/Squirrel.sln +++ b/Squirrel.sln @@ -16,6 +16,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionLevel", "SolutionLe src\Directory.Build.props = src\Directory.Build.props vendor\wix\template.wxs = vendor\wix\template.wxs version.json = version.json + .github\workflows\build.yml = .github\workflows\build.yml + build.ps1 = build.ps1 + pack.ps1 = pack.ps1 EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Squirrel.CommandLine.Windows", "src\Squirrel.CommandLine.Windows\Squirrel.CommandLine.Windows.csproj", "{19E8EBF5-0277-422F-BF49-C66D9DBA5AA4}"