From fb2d18fc1f51c73081b56586f529cb9c671a5c12 Mon Sep 17 00:00:00 2001 From: ToaHartor <41634031+ToaHartor@users.noreply.github.com> Date: Fri, 12 Jul 2024 03:23:10 +0900 Subject: [PATCH] feat(ci): dotnet 8.0 --- .github/workflows/autobuild.yaml | 2 +- .github/workflows/develop.yaml | 58 ++++++++++++++++++++++++++++++++ src/GICutscenes.csproj | 12 ++++--- 3 files changed, 66 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/develop.yaml diff --git a/.github/workflows/autobuild.yaml b/.github/workflows/autobuild.yaml index d37ddb4..93f9d0a 100644 --- a/.github/workflows/autobuild.yaml +++ b/.github/workflows/autobuild.yaml @@ -20,7 +20,7 @@ jobs: - name: Setup dotnet uses: actions/setup-dotnet@v2 with: - dotnet-version: 7.0.102 + dotnet-version: 8.0.201 - name: Build shell: bash diff --git a/.github/workflows/develop.yaml b/.github/workflows/develop.yaml new file mode 100644 index 0000000..6b347b6 --- /dev/null +++ b/.github/workflows/develop.yaml @@ -0,0 +1,58 @@ +name: Developer release + +on: + push: + branches: + - develop + +jobs: + dev-build: + name: Develop build + # All architectures supported + strategy: + matrix: + arch: ['win-x64', 'win-arm64', 'linux-x64', 'linux-arm64', 'osx-x64', 'osx.11.0-arm64', 'osx.12-arm64'] + + runs-on: ubuntu-latest + + steps: + - name: Checkout project + uses: actions/checkout@v4 + + - name: Setup dotnet + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.201 + cache: true + + - name: Install dependencies + run: dotnet restore + + - name: Build + shell: bash + # run: bash build-all.sh + run: | + version=$(cat src/GICutscenes.csproj | grep -oP "\K([0-9]\.[0-9]\.[0-9])") + release_name="GICutscenes-$version-${GITHUB_SHA::6}-${{ matrix.arch }}" + release_name_standalone="$release_name-standalone" + + # Self contained + dotnet publish -c Release -r "${{ matrix.arch }}" -o "$release_name_standalone" --self-contained + + # Framework dependant + dotnet publish -c Release -r "${{ matrix.arch }}" -o "$release_name" --self-contained false -p:PublishTrimmed=false + + if [ "${{ matrix.arch }}" == "win-x64" ]; then + # Pack for standalone version + 7z a -tzip "${release_name_standalone}.zip" "./${release_name_standalone}/*" + + # Pack for Framework dependant version + 7z a -tzip "${release_name}.zip" "./${release_name}/*" + else + tar czvf "${release_name_standalone}.tar.gz" "$release_name_standalone" + + tar czvf "${release_name}.tar.gz" "$release_name" + fi + + rm -r "$release_name_standalone" + rm -r "$release_name" \ No newline at end of file diff --git a/src/GICutscenes.csproj b/src/GICutscenes.csproj index df5c548..796d18d 100644 --- a/src/GICutscenes.csproj +++ b/src/GICutscenes.csproj @@ -3,7 +3,7 @@ 0.5.0 Exe - net6.0 + net8.0 true ToaHartor @@ -26,6 +26,7 @@ False full + 9999 @@ -33,14 +34,15 @@ true true true + 9999 - - - - + + + +