Skip to content

Commit

Permalink
Moving the main build onto windows as latest Github action Ubuntu ima…
Browse files Browse the repository at this point in the history
…ge no longer as mono
  • Loading branch information
DanHarltey committed Jan 24, 2025
1 parent c56448d commit 1e0ef76
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/main-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, buildjet-4vcpu-ubuntu-2204-arm]
env:
TEST_COVERAGE: ${{ matrix.os == 'ubuntu-latest' }}
NO_NET481: ${{ matrix.os == 'buildjet-4vcpu-ubuntu-2204-arm' }}
TEST_COVERAGE: ${{ matrix.os == 'windows-latest' }}
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: true
Expand All @@ -32,11 +31,8 @@ jobs:
if [ "$TEST_COVERAGE" == "true" ]
then
./dotnet_build.sh test_coverage
elif [ "$NO_NET481" == "true" ]
then
./dotnet_build.sh no_net481
else
./dotnet_build.sh
./dotnet_build.sh no_net481
fi
- name: Run benchmarks
Expand Down Expand Up @@ -81,3 +77,11 @@ jobs:
name: NuGet packages
path: release/Fastenshtein.*upkg
if-no-files-found: error

- name: Upload hex packages
uses: actions/upload-artifact@v4
if: env.TEST_COVERAGE == 'true'
with:
name: hex packages
path: release/Fastenshtein*.hex
if-no-files-found: error
2 changes: 1 addition & 1 deletion .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
build:
name: Relase build
runs-on: ubuntu-latest
runs-on: windows-latest

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
Expand Down
3 changes: 2 additions & 1 deletion scripts/dotnet_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ then

dotnet test ../ --configuration Release --no-build --verbosity normal --framework net481 --collect:"XPlat Code Coverage;Format=lcov"
find ../tests/Fastenshtein.Tests/TestResults/ -name "coverage.info" -type f -exec mv {} ../release/coverage.net481.info \;

xxd -plain ../src/Fastenshtein/bin/Release/net462/Fastenshtein.dll > ../release/Fastenshtein_net462.hex
elif [ $1 = "no_net481" ]
then
dotnet test ../ --configuration Release --no-build --verbosity normal --framework net9.0
Expand All @@ -28,4 +30,3 @@ dotnet pack ../ --configuration Release --no-build
cp ../src/Fastenshtein/bin/Release/Fastenshtein.*.nupkg ../release/Fastenshtein.nupkg
cp ../src/Fastenshtein/bin/Release/Fastenshtein.*.snupkg ../release/Fastenshtein.snupkg

xxd -plain ../src/Fastenshtein/bin/Release/net462/Fastenshtein.dll > ../release/Fastenshtein_net462.hex
1 change: 1 addition & 0 deletions scripts/github_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ gh release create $1 \
"../release/coverage.net481.info#Code coverage report net481" \
"../release/coverage.net9.info#Code coverage report net9" \
"../release/dotnet_info.txt#Built with" \
"../release/Fastenshtein_net462.hex#Fastenshtein hex" \
--draft \
--generate-notes

0 comments on commit 1e0ef76

Please sign in to comment.