Skip to content

F#10 on net8

F#10 on net8 #26

Workflow file for this run

name: Build and Publish NuGet Package
on:
push:
tags:
# does trigger on prerelease tags like 0.30.0-beta1 too
- '*.*.*'
jobs:
publish:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.x'
- name: Replace <br> in README.md with two spaces for nuget.org
run: |
$content = Get-Content -Path README.md -Raw
$content = $content -replace "<br>", " "
Set-Content -Path README.md -Value $content
- name: Dotnet build FeshHosting for net8
run: dotnet build FeshHosting.fsproj --configuration Release --output bin/publishNuget
- name: Check version consistency of git tag and CHANGELOG.md
# needs in fsproj:
# <Target Name="WriteChangelogVersion" AfterTargets="AfterBuild"><!-- for version checks in github tag based builds -->
# <WriteLinesToFile File="./bin/ChangelogVersion.txt" Lines="@(CurrentReleaseChangelog)" Overwrite="true" ContinueOnError="false" />
# </Target>
id: check_version
shell: bash
run: |
CHANGELOG_VERSION=$(cat ./bin/ChangelogVersion.txt | tr -d '[:space:]')
if [ "${{ github.ref_name }}" != "$CHANGELOG_VERSION" ]; then
echo "Version mismatch: git tag (${{ github.ref_name }}) and version in CHANGELOG.md ($CHANGELOG_VERSION) are not the same."
exit 1
fi
echo "CHANGELOG_VERSION=$CHANGELOG_VERSION"
echo "github.ref_name=${{ github.ref_name }}"
echo "Version check of git tag and CHANGELOG.md passed successfully."
- name: Push net10 NuGet package to nuget.org
run: |
dotnet nuget push `
./bin/publishNuget/Fesh.${{ github.ref_name }}.symbols.nupkg `
--api-key ${{ secrets.NUGET_API_KEY }} `
--source https://api.nuget.org/v3/index.json
# now that net8 is done do the same for net472
# all of this is only needed because <TargetFrameworks>net8.0-windows;net472</TargetFrameworks> does no make a valid nuget package for net48
# so we make a separate build for net8.0 and net472
- name: Set target framework to net472 in FeshHosting.fsproj
run: |
$projFile = Get-Content -Path FeshHosting.fsproj -Raw
$projFile = $projFile -replace "<TargetFramework>.*?</TargetFramework>", "<TargetFramework>net472</TargetFramework>"
Set-Content -Path FeshHosting.fsproj -Value $projFile
- name : Set -net472 suffix in changelog
run: |
$content = Get-Content -Path CHANGELOG.md -Raw
$content = $content -replace "${{ github.ref_name }}", "${{ github.ref_name }}-net472"
Set-Content -Path CHANGELOG.md -Value $content
- name: Dotnet build FeshHosting for net472
run: dotnet build FeshHosting.fsproj --configuration Release --output bin/publishNuget
- name: Push net472 NuGet package to nuget.org
run: |
dotnet nuget push `
./bin/publishNuget/Fesh.${{ github.ref_name }}-net472.symbols.nupkg `
--api-key ${{ secrets.NUGET_API_KEY }} `
--source https://api.nuget.org/v3/index.json