Skip to content

Various code fixes #304

Various code fixes

Various code fixes #304

Workflow file for this run

name: Real Build
on:
push:
branches:
- main
paths-ignore:
- '*.md'
jobs:
build:
runs-on: windows-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v1
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Install workload
run: dotnet workload install wasm-tools
- name: Build Debug
run: dotnet build Trains.NET.sln -p:CI=true -c Debug
- name: Build Release
run: dotnet build Trains.NET.sln -p:CI=true -c Release -bl
- name: Upload binary log
uses: actions/upload-artifact@v2
with:
name: binlog
path: msbuild.binlog
retention-days: 5
- name: Run tests
run: dotnet test
- name: publish
run: dotnet publish -o ./publish -r win-x64 -c Release --no-self-contained -p:PublishSingleFile=true -p:IncludeNativeLibrariesInSingleFile=true -p:IncludeAllContentForSelfExtract=true src/Trains/Trains.csproj
- name: GitVersion
id: nbgv
uses: aarnott/nbgv@master
with:
setAllVars: true
- run: |
echo 'SemVer2: ${{ steps.nbgv.outputs.SemVer2 }}'
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.nbgv.outputs.SemVer2 }}
release_name: Trains.NET v${{ steps.nbgv.outputs.SemVer2 }}
body: Trains.NET v${{ steps.nbgv.outputs.SemVer2 }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./publish/trains.exe
asset_name: trains.exe
asset_content_type: application/exe
build-blazor:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Install workload
run: dotnet workload install wasm-tools
- name: Publish app
run: dotnet publish src/BlazingTrains/BlazingTrains.csproj -c Release -p:PublishIISAssets=false
- name: GitHub Pages
if: success()
uses: crazy-max/[email protected]
with:
target_branch: gh-pages
build_dir: src/BlazingTrains/bin/Release/net8.0/publish/wwwroot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}