Skip to content

Commit

Permalink
add build script
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhathcock committed May 14, 2024
1 parent f19faa6 commit 6a7094c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: .NET
name: .NET Build and Publish

on:
pull_request:
branches: ["dui3/alpha", "dui3/ci/github-actions-test"]

jobs:
build:
build-and-publish:
runs-on: windows-latest

steps:
Expand All @@ -27,19 +24,19 @@ jobs:
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}

- name: Format
run: dotnet run --project Build/Build.csproj -- format
run: ./build.sh format

- name: Restore
run: dotnet run --project Build/Build.csproj -- restore
run: ./build.sh restore

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Build
run: dotnet run --project Build/Build.csproj -- build
run: ./build.sh build

- name: Pack
run: dotnet run --project Build/Build.csproj -- zip
run: ./build.sh zip

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down
5 changes: 2 additions & 3 deletions Build/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,8 @@ IEnumerable<string> GetFiles(string d)
x =>
{
var (path, framework) = x;

var fullPath = Path.Combine(".",
Path.GetDirectoryName(path), "bin", "Release", framework);

var fullPath = Path.Combine(".", Path.GetDirectoryName(path), "bin", "Release", framework);
var outputDir = Path.Combine(".", "output");
Directory.CreateDirectory(outputDir);
var outputPath = Path.Combine(outputDir, Path.ChangeExtension(path, "zip"));
Expand Down
3 changes: 3 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$ErrorActionPreference = "Stop";

dotnet run --project build/build.csproj -- $args
4 changes: 4 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -euo pipefail

dotnet run --project build/build.csproj -- "$@"

0 comments on commit 6a7094c

Please sign in to comment.