From 5757febac19062d31d7a9eae33f1fe1c8db47c68 Mon Sep 17 00:00:00 2001 From: Damian Edwards Date: Thu, 25 Jan 2024 22:04:59 -0800 Subject: [PATCH] Add CI workflow --- .github/workflows/ci.yml | 37 +++++++++++++++++++++++++++++++++++++ build.cmd | 6 ++++++ build.sh | 6 ++++++ build/Build.proj | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 88 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 build.cmd create mode 100644 build.sh create mode 100644 build/Build.proj diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ba0607d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,37 @@ +name: eShop Workshop CI + +on: + push: + branches: [main] + paths-ignore: + - "**/*.md" + - "**/*.gitignore" + - "**/*.gitattributes" + + pull_request: + paths-ignore: + - "**/*.md" + - "**/*.gitignore" + - "**/*.gitattributes" + + workflow_dispatch: + +jobs: + build: + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} + name: Build Repo + env: + DOTNET_CLI_TELEMETRY_OPTOUT: true + steps: + - uses: actions/checkout@v3 + + - name: Install .NET SDK + uses: actions/setup-dotnet@v3 + with: + global-json-file: ${{ matrix.os == 'ubuntu-latest' && './global.json' || '.\global.json' }} + + - name: Build + run: ${{ matrix.os == 'ubuntu-latest' && './build.sh' || '.\build.cmd' }} \ No newline at end of file diff --git a/build.cmd b/build.cmd new file mode 100644 index 0000000..838ee40 --- /dev/null +++ b/build.cmd @@ -0,0 +1,6 @@ +@ECHO OFF + +dotnet workload update --skip-sign-check --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json +dotnet workload install aspire --skip-sign-check --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json + +dotnet build .\build\Build.proj \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..7e57bdd --- /dev/null +++ b/build.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +dotnet workload update --skip-sign-check --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json +dotnet workload install aspire --skip-sign-check --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json + +dotnet build ./build/Build.proj \ No newline at end of file diff --git a/build/Build.proj b/build/Build.proj new file mode 100644 index 0000000..a5b0a04 --- /dev/null +++ b/build/Build.proj @@ -0,0 +1,39 @@ + + + net8.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file