Skip to content

Commit

Permalink
Upload pre-release package, use nugetPreRelease.fsx
Browse files Browse the repository at this point in the history
Upload pre-release package on `main` branch. Use
nugetPreRelease.fsx to get version similarly to how
FSharpLint does it.
  • Loading branch information
webwarrior-ws committed Nov 26, 2024
1 parent 009e0e3 commit a2ef272
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build-gtk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
chmod 764 $WORKLOAD_MANIFEST_DIR/*
dotnet workload search
dotnet workload install gtk --skip-manifest-update
- name: Generate pre-release version suffix
run: dotnet fsi nugetPreRelease.fsx "" > PreReleaseVersionSuffix.txt
- name: Build MAUI
run: |
mv Directory.Build.Override.props.in Directory.Build.Override.props
Expand All @@ -48,11 +50,11 @@ jobs:
done
- name: Pack MAUI
run: ./pack_mali.sh
- name: Upload binaries to nuget (if tag, and nugetKey is present)
- name: Upload binaries to nuget (if tag or main branch, and nugetKey is present)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUGET_KEY: ${{ secrets.NUGET_KEY }}
if: ${{ env.NUGET_KEY != '' && startsWith(github.ref, 'refs/tags/') }}
if: ${{ env.NUGET_KEY != '' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) }}
run: dotnet nuget push **/*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

dotnet-format:
Expand Down
3 changes: 3 additions & 0 deletions eng/Versions.targets
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@
<PackageVersion>$(PackageReferenceVersion)$(VersionMetadataPlusLabel)</PackageVersion>
<!-- Generate stable release package for tags -->
<PackageVersion Condition=" '$(GitTag)' != '' ">$(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch)</PackageVersion>
<!-- Pre-release version for other cases -->
<PreReleaseVersionSuffix>$([System.IO.File]::ReadAllText($(MSBuildThisFileDirectory)../PreReleaseVersionSuffix.txt))</PreReleaseVersionSuffix>
<PackageVersion Condition="$(CI) and '$(GitTag)' == '' ">$(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch)$(PreReleaseVersionSuffix)</PackageVersion>
</PropertyGroup>

<PropertyGroup>
Expand Down
6 changes: 6 additions & 0 deletions nugetPreRelease.fsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#r "nuget: Fsdk, Version=0.6.0--date20231213-0703.git-d7a5962"

let args = fsi.CommandLineArgs

Fsdk.Network.GetNugetPrereleaseVersionFromBaseVersion args.[1]
|> System.Console.WriteLine

0 comments on commit a2ef272

Please sign in to comment.