Skip to content

Commit

Permalink
Fix nuget publish by installing dotnet 8 where needed (#3415)
Browse files Browse the repository at this point in the history
* try with just installing net8 instead of making it the default

* include packing when building sdks

* remove duplication

* enable windows targetting

* remove duplicated package build step
  • Loading branch information
AlanRynne authored May 14, 2024
1 parent 09debd3 commit 9092757
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 15 deletions.
30 changes: 16 additions & 14 deletions .circleci/scripts/config-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ workflows:
tags:
only: /^(nuget-core|nugets)\/([0-9]+)\.([0-9]+)\.([0-9]+)(?:-\w{1,10})?$/
post-steps:
- packandpublish
- publish-nugets
context: nuget

commands:
Expand All @@ -49,20 +49,8 @@ commands:
echo 'export VERSION=$(echo $VER.$WORKFLOW_NUM)' >> "$BASH_ENV"
environment:
WORKFLOW_NUM: << pipeline.number >>

packandpublish:
publish-nugets:
steps:
- run:
name: Build nuget packages
command: |
TAG=$(if [ "${CIRCLE_TAG}" ]; then echo $CIRCLE_TAG; else echo "2.0.999"; fi;)
NOPREFIX=$(echo $TAG | sed -e 's/^[a-zA-Z]*\///')
SEMVER=$(echo "$NOPREFIX" | sed -e 's/\/[a-zA-Z-]*//')
VER=$(echo "$SEMVER" | sed -e 's/-.*//')
VERSION=$(echo $VER.$WORKFLOW_NUM)
$HOME/.dotnet/dotnet pack All.sln -p:Version=$SEMVER -p:FileVersion=$VERSION -c Release -p:IsDesktopBuild=false
environment:
WORKFLOW_NUM: << pipeline.number >>
- run:
name: Push nuget packages
command: $HOME/.dotnet/dotnet nuget push "**/*.nupkg" -s https://api.nuget.org/v3/index.json -k $NUGET_APIKEY -n --skip-duplicate
Expand Down Expand Up @@ -93,6 +81,7 @@ jobs: # Each project will have individual jobs for each specific task it has to
name: Install dotnet
command: |
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel sts
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 8.0
$HOME/.dotnet/dotnet --version
- run:
name: Enforce formatting
Expand All @@ -110,6 +99,17 @@ jobs: # Each project will have individual jobs for each specific task it has to
$HOME/.dotnet/dotnet build SDK.slnf -c Release -p:IsDesktopBuild=false -p:Version=$SEMVER -p:FileVersion=$VERSION
environment:
WORKFLOW_NUM: << pipeline.number >>
- run:
name: Build nuget packages
command: |
TAG=$(if [ "${CIRCLE_TAG}" ]; then echo $CIRCLE_TAG; else echo "2.0.999"; fi;)
NOPREFIX=$(echo $TAG | sed -e 's/^[a-zA-Z]*\///')
SEMVER=$(echo "$NOPREFIX" | sed -e 's/\/[a-zA-Z-]*//')
VER=$(echo "$SEMVER" | sed -e 's/-.*//')
VERSION=$(echo $VER.$WORKFLOW_NUM)
$HOME/.dotnet/dotnet pack All.sln -p:Version=$SEMVER -p:FileVersion=$VERSION -c Release -p:IsDesktopBuild=false
environment:
WORKFLOW_NUM: << pipeline.number >>
- run-tests:
title: Core Unit Tests
project: Core/Tests/Speckle.Core.Tests.Unit/Speckle.Core.Tests.Unit.csproj
Expand All @@ -129,6 +129,7 @@ jobs: # Each project will have individual jobs for each specific task it has to
name: Install dotnet
command: |
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel sts
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 8.0
$HOME/.dotnet/dotnet --version
- run:
name: Startup the Speckle Server
Expand Down Expand Up @@ -309,6 +310,7 @@ jobs: # Each project will have individual jobs for each specific task it has to
name: Install dotnet
command: |
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel sts
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 8.0
$HOME/.dotnet/dotnet --version
$HOME/.dotnet/dotnet --list-runtimes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<PlatformTarget>x64</PlatformTarget>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>

<Import Project="..\ConnectorAutocadCivil\ConnectorAutocadCivilShared.projitems" Label="Shared" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<PlatformTarget>x64</PlatformTarget>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>

<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>
<Import Project="..\ConnectorAutocadCivil\ConnectorAutocadCivilShared.projitems" Label="Shared" />
<Target Name="Clean">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<PlatformTarget>x64</PlatformTarget>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>

<Import Project="..\ConnectorRevit\ConnectorRevit.projitems" Label="Shared" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<DefineConstants>$(DefineConstants);REVIT2025</DefineConstants>
<RootNamespace>RevitSharedResources</RootNamespace>
<IsPackable>true</IsPackable>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<Description>Converter for Revit 2025</Description>
<PackageTags>$(PackageTags) objects converter revit</PackageTags>
<CopyToKitFolder>true</CopyToKitFolder>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>

<Import Project="..\ConverterRevitShared\ConverterRevitShared.projitems" Label="Shared" />
Expand Down

0 comments on commit 9092757

Please sign in to comment.