From f0bedf1f6f6627f239419e05f7d06258adc9d48f Mon Sep 17 00:00:00 2001 From: Callum Date: Sun, 16 Apr 2023 15:39:15 -0700 Subject: [PATCH 1/2] Created better cross-platform reelease action --- .github/workflows/YakBuild.yml | 56 +++++++++++++++------------------- 1 file changed, 24 insertions(+), 32 deletions(-) diff --git a/.github/workflows/YakBuild.yml b/.github/workflows/YakBuild.yml index 8413ace..e9b50eb 100644 --- a/.github/workflows/YakBuild.yml +++ b/.github/workflows/YakBuild.yml @@ -8,7 +8,10 @@ on: jobs: build: - runs-on: windows-latest + strategy: + matrix: + os: [windows-latest, macos-latest] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -18,42 +21,31 @@ jobs: - name: Restore Packages run: nuget restore Crash.sln - - uses: actions/setup-dotnet@v3 + - name: Setup .NET Core 6.0 + uses: actions/setup-dotnet@v3 with: - dotnet-version: | - 6.0 - 7.0 + dotnet-version: 6.0 - - name: Build Crash - run: dotnet build Crash.sln --configuration Release + - uses: FranzDiebold/github-env-vars-action@v2 - - name: Build Yak Package for Windows + - name: Set Framework Env Variable (Windows) + if : ${{ matrix.os == 'windows-latest' }} run: | - $config = "Release" - $in = Resolve-Path("src\Crash\bin\$config\net48") - $out = $in - - .\scripts\YakCompiler.ps1 -Path $in -DestinationPath $out -Config Release -os win - shell: powershell - - - name: Upload Windows Yak Package - uses: actions/upload-artifact@v3 - with: - name: crash-win-yak - path: src\Crash\bin\Release\net48\*.yak + echo "FRAMEWORK=net48" - - - name: Build Yak Package for Mac + - name: Set Framework Env Variable (Unix) + if : ${{ matrix.os != 'windows-latest' }} run: | - $config = "Release" - $in = Resolve-Path("src\Crash\bin\$config\net48") - $out = $in - - .\scripts\YakCompiler.ps1 -Path $in -DestinationPath $out -Config Release -os mac - shell: powershell + echo "FRAMEWORK=net7.0" - - name: Upload Mac Yak Package - uses: actions/upload-artifact@v3 + - name: Build Crash + run: dotnet build Crash.sln --configuration Release + + - id: yak + uses: crashcloud/yak-publish@main with: - name: crash-mac-yak - path: src\Crash\bin\Release\net48\*.yak + package-name: 'Crash' + token: ${{ secrets.YAK_TOKEN }} + build-path: 'src/Crash/bin/Release/${{env.framework}}' + publish: 'test' + platform: ${{ matrix.os }} From 94b7f7675580c88389b7ff81e3cd2915ab8556e9 Mon Sep 17 00:00:00 2001 From: Callum Date: Sun, 16 Apr 2023 15:42:02 -0700 Subject: [PATCH 2/2] net 6 -> net 7 --- .github/workflows/YakBuild.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/YakBuild.yml b/.github/workflows/YakBuild.yml index e9b50eb..03688aa 100644 --- a/.github/workflows/YakBuild.yml +++ b/.github/workflows/YakBuild.yml @@ -21,10 +21,10 @@ jobs: - name: Restore Packages run: nuget restore Crash.sln - - name: Setup .NET Core 6.0 + - name: Setup .NET Core 7.0 uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.0 + dotnet-version: 7.0 - uses: FranzDiebold/github-env-vars-action@v2