From ba3808032634a067241d4e2469d2b164db87fa39 Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Thu, 6 May 2021 07:39:21 -0700 Subject: [PATCH] Add Mac agent to Actions workflow. --- .github/workflows/build.yml | 48 ++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 06d26167..97949c81 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,11 +32,50 @@ on: default: "linux-x64" jobs: + build-mac: + runs-on: macos-10.15 + + steps: + - name: Checkout + uses: actions/checkout@v2 - build: + - name: Install .NET Core + uses: actions/setup-dotnet@v1.7.2 + + - name: Set current version + shell: powershell + run: | + $VersionString = git show -s --format=%ci + $VersionDate = [DateTimeOffset]::Parse($VersionString) + + $Year = $VersionDate.Year.ToString() + $Month = $VersionDate.Month.ToString().PadLeft(2, "0") + $Day = $VersionDate.Day.ToString().PadLeft(2, "0") + $Hour = $VersionDate.Hour.ToString().PadLeft(2, "0") + $Minute = $VersionDate.Minute.ToString().PadLeft(2, "0") + $CurrentVersion = "$Year.$Month.$Day.$Hour$Minute" + + echo "CurrentVersion=$CurrentVersion" >> $GITHUB_ENV + + Write-Host "Setting current version to $CurrentVersion." + + - name: Set current version + shell: powershell + run: | + dotnet publish /p:Version=$env:CurrentVersion /p:FileVersion=$env:CurrentVersion --runtime osx-x64 --configuration Release --output "./Agent/bin/publish" ".\Agent" + Compress-Archive -Path "./Agent/bin/publish/*" -DestinationPath "./Agent/bin/Remotely-MacOS-x64.zip" -Force + + - name: Upload build artifact + uses: actions/upload-artifact@v2 + with: + path: ./Agent/bin/Remotely-MacOS-x64.zip + name: Mac-Agent-x64 + + build-windows: runs-on: windows-latest # For a list of available runner types, refer to # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on + needs: build-mac env: Solution_Name: Remotely.sln @@ -46,6 +85,13 @@ jobs: ServerUrl: ${{ github.event.inputs.serverUrl }} steps: + + - uses: actions/download-artifact@v2 + with: + name: Mac-Agent-x64 + path: ./Server/wwwroot/Content/Remotely-MacOS-x64.zip + + - name: Checkout uses: actions/checkout@v2 with: