From 6057ec3a59fcc5678081c4e30e4375baf4ab1d46 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 23 Feb 2024 10:20:30 -0500 Subject: [PATCH] Split CI workflow files --- .github/workflows/build_check.yml | 38 ++++++++++++++++ .github/workflows/build_ui.yml | 45 +++++++++++++++++++ .github/workflows/ci.yml | 75 ------------------------------- CHANGELIST.md | 1 + MPF.sln | 3 +- 5 files changed, 86 insertions(+), 76 deletions(-) create mode 100644 .github/workflows/build_check.yml create mode 100644 .github/workflows/build_ui.yml delete mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml new file mode 100644 index 00000000..e6136437 --- /dev/null +++ b/.github/workflows/build_check.yml @@ -0,0 +1,38 @@ +name: Build MPF Check + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + project: [MPF.Check] + runtime: [win-x86, win-x64, linux-x64, osx-x64] #[win-x86, win-x64, win-arm64, linux-x64, linux-arm64, osx-x64] + framework: [net8.0] #[net20, net35, net40, net452, net472, net48, netcoreapp3.1, net5.0, net6.0, net7.0, net8.0] + conf: [Release, Debug] + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet publish ${{ matrix.project }}/${{ matrix.project }}.csproj -f ${{ matrix.framework }} -r ${{ matrix.runtime }} -c ${{ matrix.conf == 'Release' && 'Release -p:DebugType=None -p:DebugSymbols=false' || 'Debug'}} --self-contained true --version-suffix ${{ github.sha }} ${{ (startsWith(matrix.framework, 'net5') || startsWith(matrix.framework, 'net6') || startsWith(matrix.framework, 'net7') || startsWith(matrix.framework, 'net8')) && '-p:PublishSingleFile=true' || ''}} + + - name: Upload build + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.project }}_${{ github.run_number }}_${{ matrix.framework }}_${{ matrix.runtime }}_${{ matrix.conf }} + path: ${{ matrix.project }}/bin/${{ matrix.conf }}/${{ matrix.framework }}/${{ matrix.runtime }}/publish/ diff --git a/.github/workflows/build_ui.yml b/.github/workflows/build_ui.yml new file mode 100644 index 00000000..1aa6d975 --- /dev/null +++ b/.github/workflows/build_ui.yml @@ -0,0 +1,45 @@ +name: Build MPF UI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + project: [MPF] + runtime: [win-x86, win-x64] + framework: [net8.0-windows] #[net40, net452, net472, net48, netcoreapp3.1, net5.0-windows, net6.0-windows, net7.0-windows, net8.0-windows] + conf: [Release, Debug] + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet publish ${{ matrix.project }}/${{ matrix.project }}.csproj -f ${{ matrix.framework }} -r ${{ matrix.runtime }} -c ${{ matrix.conf == 'Release' && 'Release -p:DebugType=None -p:DebugSymbols=false' || 'Debug'}} --self-contained true --version-suffix ${{ github.sha }} ${{ (startsWith(matrix.framework, 'net5') || startsWith(matrix.framework, 'net6') || startsWith(matrix.framework, 'net7') || startsWith(matrix.framework, 'net8')) && '-p:PublishSingleFile=true' || ''}} + + - name: Bundle Redumper + run: | + wget https://github.com/superg/redumper/releases/download/build_311/redumper-2024.01.08_build311-win64.zip + unzip redumper-2024.01.08_build311-win64.zip + mkdir -p MPF/bin/${{ matrix.conf }}/${{ matrix.framework }}/${{ matrix.runtime }}/publish/Programs/Redumper + mv redumper-2024.01.08_build311-win64/bin/redumper.exe MPF/bin/${{ matrix.conf }}/${{ matrix.framework }}/${{ matrix.runtime }}/publish/Programs/Redumper/ + + - name: Upload build + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.project }}_${{ github.run_number }}_${{ matrix.framework }}_${{ matrix.runtime }}_${{ matrix.conf }} + path: ${{ matrix.project }}/bin/${{ matrix.conf }}/${{ matrix.framework }}/${{ matrix.runtime }}/publish/ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index e8cab657..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: MPF CI - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - project: [MPF, MPF.Check] - runtime: [win-x86, win-x64, linux-x64, osx-x64] #[win-x86, win-x64, win-arm64, linux-x64, linux-arm64, osx-x64] - framework: [net8.0, net8.0-windows] #[net20, net35, net40, net452, net472, net48, netcoreapp3.1, net5.0, net6.0, net7.0, net8.0, net5.0-windows, net6.0-windows, net7.0-windows, net8.0-windows] - conf: [Release, Debug] - exclude: - - project: MPF - runtime: linux-x64 - - project: MPF - runtime: osx-x64 - #- project: MPF - # runtime: linux-arm64 - #- project: MPF - # framework: net20 - #- project: MPF - # framework: net35 - #- project: MPF - # framework: net5.0 - #- project: MPF - # framework: net6.0 - #- project: MPF - # framework: net7.0 - - project: MPF - framework: net8.0 - #- project: MPF.Check - # framework: net5.0-windows - #- project: MPF.Check - # framework: net6.0-windows - #- project: MPF.Check - # framework: net7.0-windows - - project: MPF.Check - framework: net8.0-windows - - steps: - - uses: actions/checkout@v4 - - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 8.0.x - - - name: Restore dependencies - run: dotnet restore - - - name: Build - run: dotnet publish ${{ matrix.project }}/${{ matrix.project }}.csproj -f ${{ matrix.framework }} -r ${{ matrix.runtime }} -c ${{ matrix.conf == 'Release' && 'Release -p:DebugType=None -p:DebugSymbols=false' || 'Debug'}} --self-contained true --version-suffix ${{ github.sha }} ${{ (startsWith(matrix.framework, 'net5') || startsWith(matrix.framework, 'net6') || startsWith(matrix.framework, 'net7') || startsWith(matrix.framework, 'net8'))&& '-p:PublishSingleFile=true' || ''}} - - - if: ${{ matrix.project == 'MPF' && matrix.framework == 'net8.0-windows' && matrix.conf == 'Debug'}} - name: Bundle Redumper - run: | - wget https://github.com/superg/redumper/releases/download/build_311/redumper-2024.01.08_build311-win64.zip - unzip redumper-2024.01.08_build311-win64.zip - mkdir -p MPF/bin/${{ matrix.conf }}/${{ matrix.framework }}/${{ matrix.runtime }}/publish/Programs/Redumper - mv redumper-2024.01.08_build311-win64/bin/redumper.exe MPF/bin/${{ matrix.conf }}/${{ matrix.framework }}/${{ matrix.runtime }}/publish/Programs/Redumper/ - - - if: ${{ (matrix.project == 'MPF' && matrix.framework == 'net8.0-windows' && matrix.conf == 'Debug') - || (matrix.project == 'MPF.Check' && matrix.framework == 'net8.0' && matrix.conf == 'Debug')}} - name: Upload build - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.project }}_${{ github.run_number }}_${{ matrix.framework }}_${{ matrix.runtime }}_${{ matrix.conf }} - path: ${{ matrix.project }}/bin/${{ matrix.conf }}/${{ matrix.framework }}/${{ matrix.runtime }}/publish/ diff --git a/CHANGELIST.md b/CHANGELIST.md index b1ca7ccc..d5545247 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -13,6 +13,7 @@ - Opt-in automatic IRD creation after PS3 dump (Deterous) - Add CI via Github Workflows (Deterous) - Reorganize solution items +- Split CI workflow files ### 3.1.1 (2024-02-20) diff --git a/MPF.sln b/MPF.sln index b612c24b..e820cbd9 100644 --- a/MPF.sln +++ b/MPF.sln @@ -33,7 +33,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ISSUE_TEMPLATE", "ISSUE_TEM EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{440776E0-E6E2-46C6-8E85-09E64A8FC7D6}" ProjectSection(SolutionItems) = preProject - .github\workflows\ci.yml = .github\workflows\ci.yml + .github\workflows\build_check.yml = .github\workflows\build_check.yml + .github\workflows\build_ui.yml = .github\workflows\build_ui.yml EndProjectSection EndProject Global