From 52b111905258fc09347eab0c9f8facffee2e4e39 Mon Sep 17 00:00:00 2001 From: stil Date: Sun, 10 Dec 2023 17:22:18 +0100 Subject: [PATCH] Update GitHub workflow for .NET 8 --- .github/workflows/build.yml | 26 +++++++++++++------------- workflowgen.cmd | 1 + workflowgen.ts | 10 ++++++---- 3 files changed, 20 insertions(+), 17 deletions(-) create mode 100644 workflowgen.cmd diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62b0776..42a6d93 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: - name: Setup .NET Core SDK ${{ matrix.dotnet-version }} uses: actions/setup-dotnet@v3 with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x # Build win-x64 @@ -29,13 +29,13 @@ jobs: run: dotnet publish --configuration Release --self-contained -p:PublishSingleFile=true -r win10-x64 #- name: ZIP win-x64 # if: matrix.platform == 'windows-latest' - # run: 7z a -tzip artifacts/efmig-win-x64-Release.zip ./Efmig/bin/Release/net7.0/win10-x64/publish/* + # run: 7z a -tzip artifacts/efmig-win-x64-Release.zip ./Efmig/bin/Release/net8.0/win10-x64/publish/* - name: Upload win-x64 artifacts if: matrix.platform == 'windows-latest' uses: actions/upload-artifact@v3 with: name: efmig-win-x64-Release - path: Efmig/bin/Release/net7.0/win10-x64/publish/ + path: Efmig/bin/Release/net8.0/win10-x64/publish/ if-no-files-found: error # Build win-arm64 @@ -44,13 +44,13 @@ jobs: run: dotnet publish --configuration Release --self-contained -p:PublishSingleFile=true -r win10-arm64 #- name: ZIP win-arm64 # if: matrix.platform == 'windows-latest' - # run: 7z a -tzip artifacts/efmig-win-arm64-Release.zip ./Efmig/bin/Release/net7.0/win10-arm64/publish/* + # run: 7z a -tzip artifacts/efmig-win-arm64-Release.zip ./Efmig/bin/Release/net8.0/win10-arm64/publish/* - name: Upload win-arm64 artifacts if: matrix.platform == 'windows-latest' uses: actions/upload-artifact@v3 with: name: efmig-win-arm64-Release - path: Efmig/bin/Release/net7.0/win10-arm64/publish/ + path: Efmig/bin/Release/net8.0/win10-arm64/publish/ if-no-files-found: error # Build linux-x64 @@ -59,13 +59,13 @@ jobs: run: dotnet publish --configuration Release --self-contained -p:PublishSingleFile=true -r linux-x64 #- name: ZIP linux-x64 # if: matrix.platform == 'ubuntu-latest' - # run: 7z a -tzip artifacts/efmig-linux-x64-Release.zip ./Efmig/bin/Release/net7.0/linux-x64/publish/* + # run: 7z a -tzip artifacts/efmig-linux-x64-Release.zip ./Efmig/bin/Release/net8.0/linux-x64/publish/* - name: Upload linux-x64 artifacts if: matrix.platform == 'ubuntu-latest' uses: actions/upload-artifact@v3 with: name: efmig-linux-x64-Release - path: Efmig/bin/Release/net7.0/linux-x64/publish/ + path: Efmig/bin/Release/net8.0/linux-x64/publish/ if-no-files-found: error # Build linux-arm64 @@ -74,13 +74,13 @@ jobs: run: dotnet publish --configuration Release --self-contained -p:PublishSingleFile=true -r linux-arm64 #- name: ZIP linux-arm64 # if: matrix.platform == 'ubuntu-latest' - # run: 7z a -tzip artifacts/efmig-linux-arm64-Release.zip ./Efmig/bin/Release/net7.0/linux-arm64/publish/* + # run: 7z a -tzip artifacts/efmig-linux-arm64-Release.zip ./Efmig/bin/Release/net8.0/linux-arm64/publish/* - name: Upload linux-arm64 artifacts if: matrix.platform == 'ubuntu-latest' uses: actions/upload-artifact@v3 with: name: efmig-linux-arm64-Release - path: Efmig/bin/Release/net7.0/linux-arm64/publish/ + path: Efmig/bin/Release/net8.0/linux-arm64/publish/ if-no-files-found: error # Build osx-x64 @@ -89,13 +89,13 @@ jobs: run: dotnet publish --configuration Release --self-contained -p:PublishSingleFile=true -r osx-x64 #- name: ZIP osx-x64 # if: matrix.platform == 'macos-latest' - # run: 7z a -tzip artifacts/efmig-osx-x64-Release.zip ./Efmig/bin/Release/net7.0/osx-x64/publish/* + # run: 7z a -tzip artifacts/efmig-osx-x64-Release.zip ./Efmig/bin/Release/net8.0/osx-x64/publish/* - name: Upload osx-x64 artifacts if: matrix.platform == 'macos-latest' uses: actions/upload-artifact@v3 with: name: efmig-osx-x64-Release - path: Efmig/bin/Release/net7.0/osx-x64/publish/ + path: Efmig/bin/Release/net8.0/osx-x64/publish/ if-no-files-found: error # Build osx-arm64 @@ -104,11 +104,11 @@ jobs: run: dotnet publish --configuration Release --self-contained -p:PublishSingleFile=true -r osx.11.0-arm64 #- name: ZIP osx-arm64 # if: matrix.platform == 'macos-latest' - # run: 7z a -tzip artifacts/efmig-osx-arm64-Release.zip ./Efmig/bin/Release/net7.0/osx.11.0-arm64/publish/* + # run: 7z a -tzip artifacts/efmig-osx-arm64-Release.zip ./Efmig/bin/Release/net8.0/osx.11.0-arm64/publish/* - name: Upload osx-arm64 artifacts if: matrix.platform == 'macos-latest' uses: actions/upload-artifact@v3 with: name: efmig-osx-arm64-Release - path: Efmig/bin/Release/net7.0/osx.11.0-arm64/publish/ + path: Efmig/bin/Release/net8.0/osx.11.0-arm64/publish/ if-no-files-found: error \ No newline at end of file diff --git a/workflowgen.cmd b/workflowgen.cmd new file mode 100644 index 0000000..d9e9d77 --- /dev/null +++ b/workflowgen.cmd @@ -0,0 +1 @@ +deno.exe run --allow-write .\workflowgen.ts \ No newline at end of file diff --git a/workflowgen.ts b/workflowgen.ts index 8249f0c..1164b2d 100644 --- a/workflowgen.ts +++ b/workflowgen.ts @@ -1,3 +1,5 @@ +const targetFramework = "net8.0"; + const platformTemplateGen = (name: string, rid: string, platform: string) => ` # Build ${name} @@ -6,13 +8,13 @@ const platformTemplateGen = (name: string, rid: string, platform: string) => run: dotnet publish --configuration Release --self-contained -p:PublishSingleFile=true -r ${rid} #- name: ZIP ${name} # if: matrix.platform == '${platform}' - # run: 7z a -tzip artifacts/efmig-${name}-Release.zip ./Efmig/bin/Release/net7.0/${rid}/publish/* + # run: 7z a -tzip artifacts/efmig-${name}-Release.zip ./Efmig/bin/Release/${targetFramework}/${rid}/publish/* - name: Upload ${name} artifacts if: matrix.platform == '${platform}' uses: actions/upload-artifact@v3 with: name: efmig-${name}-Release - path: Efmig/bin/Release/net7.0/${rid}/publish/ + path: Efmig/bin/Release/${targetFramework}/${rid}/publish/ if-no-files-found: error `; @@ -48,9 +50,9 @@ jobs: - name: Setup .NET Core SDK \${{ matrix.dotnet-version }} uses: actions/setup-dotnet@v3 with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x ${extraSteps} `.trim(); -Deno.writeTextFile(".github/workflows/build.yml", template); \ No newline at end of file +Deno.writeTextFile(".github/workflows/build.yml", template);