From 8c9dbed68b482a1cd2dbb7b263ae16d84122f1a7 Mon Sep 17 00:00:00 2001 From: Cory Knox Date: Thu, 13 Jun 2024 11:17:08 -0700 Subject: [PATCH] (#3465) Build MSI on GHA As with the previous commit, this adds the configuration for GitHub Actions. Thus allowing us to ensure the MSI is able to be built in GitHub Actions as well. When running the builds in CI, we should generate the MSI as well. This will allow us to get an MSI for any build to test with if needed. --- .github/workflows/build.yml | 286 ++++++++++++++++++------------------ 1 file changed, 143 insertions(+), 143 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 094d07b875..3a599451ab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,143 +1,143 @@ -name: Chocolatey Builds - -on: - # Trigger on pushes and on pull requests - push: - pull_request: - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - # Build using mono on Ubuntu - ubuntu-build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Cache Tools - uses: actions/cache@v3.0.11 - with: - path: tools - key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }} - - name: Build with Mono - run: | - chmod +x build.sh - $GITHUB_WORKSPACE//build.sh --verbosity=diagnostic --target=CI --testExecutionType=unit - - name: Upload Ubuntu build results - uses: actions/upload-artifact@v3 - # Always upload build results - if: ${{ always() }} - with: - name: ubuntu-build-results - path: | - code_drop/TestResults/issues-report.html - code_drop/TestResults/NUnit/TestResult.xml - code_drop/Packages/NuGet/*.nupkg - code_drop/MsBuild.log - # Build on Windows - windows-build: - runs-on: windows-2019 - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Cache Tools - uses: actions/cache@v3.0.11 - with: - path: tools - key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }} - - name: Build with .Net Framework - shell: powershell - run: ./build.ps1 --verbosity=diagnostic --target=CI --testExecutionType=unit --shouldRunOpenCover=false - - name: Upload Windows build results - uses: actions/upload-artifact@v3 - # Always upload build results - if: ${{ always() }} - with: - name: windows-build-results - path: | - code_drop\TestResults\issues-report.html - code_drop\TestResults\NUnit\TestResult.xml - code_drop\TestCoverage\lcov.info - code_drop\TestCoverage\OpenCover.xml - code_drop\ilmerge-chocoexe.log - code_drop\ilmerge-chocolateydll.log - code_drop\Packages\NuGet\*.nupkg - code_drop\Packages\Chocolatey\*.nupkg - code_drop\MsBuild.log - # - uses: coverallsapp/github-action@master - # with: - # github-token: ${{ secrets.GITHUB_TOKEN }} - # path-to-lcov: | - # code_drop\TestCoverage\lcov.info - # flag-name: run-${{ matrix.os }} - # parallel: true - # Build using mono on MacOS - macos-build: - runs-on: macos-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Cache Tools - uses: actions/cache@v3.0.11 - with: - path: tools - key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }} - - name: Build with Mono - run: | - chmod +x build.sh - $GITHUB_WORKSPACE//build.sh --verbosity=diagnostic --target=CI --testExecutionType=unit - - name: Upload MacOS build results - uses: actions/upload-artifact@v3 - # Always upload build results - if: ${{ always() }} - with: - name: macos-build-results - path: | - code_drop/TestResults/issues-report.html - code_drop/TestResults/NUnit/TestResult.xml - code_drop/Packages/NuGet/*.nupkg - code_drop/MsBuild.log - # Build using Mono in Docker on Ubuntu - docker-build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Cache Tools - uses: actions/cache@v3.0.11 - with: - path: tools - key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }} - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Build and push - uses: docker/build-push-action@v3 - with: - context: . - file: docker/Dockerfile.linux - push: false - tags: chocolatey/choco:latest - build-args: | - "github_actions=true" - "github_ref=${{ github.ref }}" - "github_repository=${{ github.repository }}" - "github_base_ref=${{ github.base_ref }}" - "github_head_ref=${{ github.head_ref }}" - "github_run_number=${{ github.run_number }}" - #upload-code-coverage-results: - # needs: [ubuntu-build, windows-build, macos-build] - # runs-on: ubuntu-latest - # steps: - # - name: Coveralls Finished - # uses: coverallsapp/github-action@master - # with: - # github-token: ${{ secrets.GITHUB_TOKEN }} - # parallel-finished: true \ No newline at end of file +name: Chocolatey Builds + +on: + # Trigger on pushes and on pull requests + push: + pull_request: + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + # Build using mono on Ubuntu + ubuntu-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Cache Tools + uses: actions/cache@v3.0.11 + with: + path: tools + key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }} + - name: Build with Mono + run: | + chmod +x build.sh + $GITHUB_WORKSPACE//build.sh --verbosity=diagnostic --target=CI --testExecutionType=unit + - name: Upload Ubuntu build results + uses: actions/upload-artifact@v3 + # Always upload build results + if: ${{ always() }} + with: + name: ubuntu-build-results + path: | + code_drop/TestResults/issues-report.html + code_drop/TestResults/NUnit/TestResult.xml + code_drop/Packages/NuGet/*.nupkg + code_drop/MsBuild.log + # Build on Windows + windows-build: + runs-on: windows-2019 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Cache Tools + uses: actions/cache@v3.0.11 + with: + path: tools + key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }} + - name: Build with .Net Framework + shell: powershell + run: ./build.ps1 --verbosity=diagnostic --target=CI --testExecutionType=unit --shouldRunOpenCover=false + - name: Upload Windows build results + uses: actions/upload-artifact@v3 + # Always upload build results + if: ${{ always() }} + with: + name: windows-build-results + path: | + code_drop\TestResults\issues-report.html + code_drop\TestResults\NUnit\TestResult.xml + code_drop\TestCoverage\lcov.info + code_drop\TestCoverage\OpenCover.xml + code_drop\ilmerge-chocoexe.log + code_drop\ilmerge-chocolateydll.log + code_drop\Packages\NuGet\*.nupkg + code_drop\Packages\Chocolatey\*.nupkg + code_drop\MsBuild.log + # - uses: coverallsapp/github-action@master + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} + # path-to-lcov: | + # code_drop\TestCoverage\lcov.info + # flag-name: run-${{ matrix.os }} + # parallel: true + # Build using mono on MacOS + macos-build: + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Cache Tools + uses: actions/cache@v3.0.11 + with: + path: tools + key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }} + - name: Build with Mono + run: | + chmod +x build.sh + $GITHUB_WORKSPACE//build.sh --verbosity=diagnostic --target=CI --testExecutionType=unit --shouldBuildMsi=true + - name: Upload MacOS build results + uses: actions/upload-artifact@v3 + # Always upload build results + if: ${{ always() }} + with: + name: macos-build-results + path: | + code_drop/TestResults/issues-report.html + code_drop/TestResults/NUnit/TestResult.xml + code_drop/Packages/NuGet/*.nupkg + code_drop/MsBuild.log + # Build using Mono in Docker on Ubuntu + docker-build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Cache Tools + uses: actions/cache@v3.0.11 + with: + path: tools + key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + file: docker/Dockerfile.linux + push: false + tags: chocolatey/choco:latest + build-args: | + "github_actions=true" + "github_ref=${{ github.ref }}" + "github_repository=${{ github.repository }}" + "github_base_ref=${{ github.base_ref }}" + "github_head_ref=${{ github.head_ref }}" + "github_run_number=${{ github.run_number }}" + #upload-code-coverage-results: + # needs: [ubuntu-build, windows-build, macos-build] + # runs-on: ubuntu-latest + # steps: + # - name: Coveralls Finished + # uses: coverallsapp/github-action@master + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} + # parallel-finished: true