diff --git a/.github/workflows/build-rel.yml b/.github/workflows/build-rel.yml index 5a1b10f..a5d22e6 100644 --- a/.github/workflows/build-rel.yml +++ b/.github/workflows/build-rel.yml @@ -16,15 +16,19 @@ jobs: runs-on: ${{ matrix.runs-on }} steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.ref }} - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '8.0.x' - - name: Solution Compilation - run: dotnet build --configuration Release - - name: Testing - run: dotnet test --no-build --configuration Release + - uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' + - name: Solution Compilation (Windows) + if: matrix.runs-on == 'windows-latest' + run: cd tools ; ./build.cmd ; cd .. + - name: Solution Compilation (Unix) + if: matrix.runs-on != 'windows-latest' + run: make + - name: Testing + run: dotnet test --no-build --configuration Release diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2901d9a..9e1d3d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,15 +16,19 @@ jobs: runs-on: ${{ matrix.runs-on }} steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.ref }} - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '8.0.x' - - name: Solution Compilation - run: dotnet build --configuration Debug - - name: Testing - run: dotnet test --no-build --configuration Debug + - uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' + - name: Solution Compilation (Windows) + if: matrix.runs-on == 'windows-latest' + run: cd tools ; ./build.cmd Debug ; cd .. + - name: Solution Compilation (Unix) + if: matrix.runs-on != 'windows-latest' + run: make dbg + - name: Testing + run: dotnet test --no-build --configuration Debug diff --git a/.github/workflows/docgen.yml b/.github/workflows/docgen.yml index 01a74dd..5a36795 100644 --- a/.github/workflows/docgen.yml +++ b/.github/workflows/docgen.yml @@ -21,10 +21,8 @@ jobs: dotnet-version: '8.0.x' - name: Setup DocFX run: dotnet tool install --global docfx - - name: Solution Compilation - run: dotnet build --configuration Release - - name: Generating documentation - run: docfx DocGen/docfx.json + - name: Generating Documentation + run: make doc - name: Saving changes to gh-pages uses: peaceiris/actions-gh-pages@v3 with: diff --git a/.github/workflows/pack.yml b/.github/workflows/pack.yml index 35c2241..8be901c 100644 --- a/.github/workflows/pack.yml +++ b/.github/workflows/pack.yml @@ -18,7 +18,7 @@ jobs: with: dotnet-version: '8.0.x' - name: Solution Compilation - run: dotnet build --configuration Release + run: make - name: Package Publication run: | dotnet nuget push "Figletize/bin/Release/*.nupkg" --api-key ${{ secrets.NUGET_APIKEY }} --source "nuget.org" diff --git a/.github/workflows/prepdraft.yml b/.github/workflows/prepdraft.yml index e83897b..bfeb5e4 100644 --- a/.github/workflows/prepdraft.yml +++ b/.github/workflows/prepdraft.yml @@ -8,29 +8,28 @@ on: jobs: build: - runs-on: windows-latest + runs-on: ubuntu-latest permissions: contents: write steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.ref }} - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '8.0.x' - - name: Setup DocFX - run: dotnet tool install --global docfx - - name: Release Asset Preparation - run: | - cd tools ; ./build.cmd ; cd .. - cd tools ; ./pack.cmd ; cd .. - cd tools ; ./docgen.cmd ; cd .. - cd tools ; ./docgen-pack.cmd ; cd .. - - name: Release Draft Making - uses: softprops/action-gh-release@v1 - with: - body: "This is a draft release. Fill this with a release snippet from the release sheet made internally." - draft: true - files: | - tools/*.zip + - uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' + - name: Setup DocFX + run: dotnet tool install --global docfx + - name: Release Asset Preparation + run: | + chmod +x tools/*.sh + make doc + cd tools ; ./docgen-pack.sh ; cd .. + - name: Release Draft Making + uses: softprops/action-gh-release@v1 + with: + body: "This is a draft release. Fill this with a release snippet from the release sheet made internally." + draft: true + files: | + tools/*.zip diff --git a/Makefile b/Makefile index d5480c7..79f3b51 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,12 @@ all: all-online all-online: $(MAKE) -C tools invoke-build +dbg: + $(MAKE) -C tools invoke-build ENVIRONMENT=Debug + +doc: + $(MAKE) -C tools invoke-doc-build + clean: rm -rf $(OUTPUTS) diff --git a/tools/Makefile b/tools/Makefile index a2fd9b1..bc12777 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -10,4 +10,8 @@ DOTNET_HEAP_LIMIT = $(shell printf '%X\n' $$(($(DOTNET_AVPHYS_PAGES) * $(DOTNET_ invoke-build: chmod +x ./build.sh - ./build.sh || (echo Retrying with heap limit 0x$(DOTNET_HEAP_LIMIT)... && DOTNET_GCHeapHardLimit=$(DOTNET_HEAP_LIMIT) ./build.sh) + ./build.sh $(ENVIRONMENT) || (echo Retrying with heap limit 0x$(DOTNET_HEAP_LIMIT)... && DOTNET_GCHeapHardLimit=$(DOTNET_HEAP_LIMIT) ./build.sh $(ENVIRONMENT)) + +invoke-doc-build: invoke-build + chmod +x ./docgen.sh + ./docgen.sh || (echo Retrying with heap limit 0x$(DOTNET_HEAP_LIMIT)... && DOTNET_GCHeapHardLimit=$(DOTNET_HEAP_LIMIT) ./docgen.sh) diff --git a/tools/pack.cmd b/tools/pack.cmd deleted file mode 100644 index 5ddc1b9..0000000 --- a/tools/pack.cmd +++ /dev/null @@ -1,23 +0,0 @@ -@echo off - -REM Copyright Drew Noakes. Licensed under the Apache-2.0 license. See the LICENSE file for more details. -REM Copyright 2023-2024 - Aptivi. Licensed under the Apache-2.0 license. See the LICENSE file for more details. - -for /f "tokens=* USEBACKQ" %%f in (`type version`) do set version=%%f -set releaseconfig=%1 -if "%releaseconfig%" == "" set releaseconfig=Release - -:packbin -echo Packing binary... -"%ProgramFiles%\7-Zip\7z.exe" a -tzip %temp%/%version%-bin.zip "..\Figletize\bin\%releaseconfig%\netstandard2.0\*" -"%ProgramFiles%\7-Zip\7z.exe" a -tzip %temp%/%version%-demo.zip "..\Figletize.Cmd\bin\%releaseconfig%\net8.0\*" -if %errorlevel% == 0 goto :complete -echo There was an error trying to pack binary (%errorlevel%). -goto :finished - -:complete -move %temp%\%version%-bin.zip -move %temp%\%version%-demo.zip - -echo Pack successful. -:finished diff --git a/tools/pack.sh b/tools/pack.sh deleted file mode 100644 index 2635cb7..0000000 --- a/tools/pack.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -# Copyright Drew Noakes. Licensed under the Apache-2.0 license. See the LICENSE file for more details. -# Copyright 2023-2024 - Aptivi. Licensed under the Apache-2.0 license. See the LICENSE file for more details. - -# This script builds and packs the artifacts. Use when you have MSBuild installed. -version=$(cat version) -releaseconf=$1 -if [ -z $releaseconf ]; then - releaseconf=Release -fi - -# Check for dependencies -zippath=`which zip` -if [ ! $? == 0 ]; then - echo zip is not found. - exit 1 -fi - -# Pack binary -echo Packing binary... -cd "../Figletize/bin/$releaseconf/netstandard2.0/" && "$zippath" -r /tmp/$version-bin.zip . && cd - -cd "../Figletize.Cmd/bin/$releaseconf/net8.0/" && "$zippath" -r /tmp/$version-demo.zip . && cd - -if [ ! $? == 0 ]; then - echo Packing using zip failed. - exit 1 -fi - -# Inform success -mv ~/tmp/$version-bin.zip . -mv ~/tmp/$version-demo.zip . -echo Build and pack successful. -exit 0