Skip to content

Commit

Permalink
Merge pull request #66 from Geodan/to_net_8
Browse files Browse the repository at this point in the history
To net 8
  • Loading branch information
bertt authored Jul 22, 2024
2 parents a04dd2c + 226546b commit afb2747
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 44 deletions.
28 changes: 7 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,23 @@
name: .NET

on: push

on:
push:
branches: [ '**' ]
pull_request:
branches: [ '**' ]
jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.100
dotnet-version: 8.0.x
- name: Build
working-directory: src
run: dotnet build --configuration Release
- name: Test
working-directory: tests
run: dotnet test --configuration Release

publishdocker:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag geodan/i3dm.export:latest
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Publish the Docker image
run: docker push geodan/i3dm.export:latest
run: dotnet test --configuration Release
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0 as build
FROM mcr.microsoft.com/dotnet/sdk:8.0 as build
WORKDIR /src
COPY . .
RUN dotnet build "src/i3dm.export.csproj" -c Release
RUN dotnet publish "src/i3dm.export.csproj" -c Release -o /app

FROM mcr.microsoft.com/dotnet/runtime:6.0
FROM mcr.microsoft.com/dotnet/runtime:8.0
WORKDIR /app
COPY --from=build /app /app/
ENTRYPOINT ["dotnet", "i3dm.export.dll"]
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ For composite tile (cmpt) specs see https://github.com/CesiumGS/3d-tiles/blob/ma
## Installation


Prerequisite: .NET 6.0 SDK is installed https://dotnet.microsoft.com/download/dotnet/6.0
Prerequisite: .NET 8.0 SDK is installed https://dotnet.microsoft.com/download/dotnet/8.0

```
$ dotnet tool install -g i3dm.export
Expand Down Expand Up @@ -292,6 +292,8 @@ To Visualize in CesiumJS, add references to:

## History

2024-07-22: release 2.8.0: to .NET 8.0

2024-06-20: release 2.7.4: fix for composite tiles when using GPU instancing

2024-06-13: release 2.7.3: add support for other input source EPSG codes than 4326
Expand Down
17 changes: 4 additions & 13 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ Some open source tooling is used in this tutorial:

- psql https://www.postgresql.org/docs/9.2/app-psql.html

- .NET 6.0 https://dotnet.microsoft.com/download/dotnet/6.0

- Python 3 https://www.python.org/

## Install i3dm.export

See releases for executables for Windows, Linux and MacOS

## Download data

```
Expand Down Expand Up @@ -82,17 +84,6 @@ postgres=# CREATE INDEX geom_idx ON traffic_signs_instances USING GIST (geom);
postgres=# delete from traffic_signs_instances where st_x(geom) < 4.5 or st_x(geom)>5.0;
postgres=# exit;
```
## Install i3dm.export

```
$ dotnet tool install -g i3dm.export
```

To visualize in MapBox GL JS use a 2.X version (because 3D Tiles 1.1 - implicit tiling is not supported yet):

```
$ dotnet tool install --global i3dm.export --version 1.9.0
```

Download Box.glb from https://raw.githubusercontent.com/Geodan/i3dm.export/main/docs/Box.glb

Expand Down
Binary file added i3dm.export-win-x64.zip
Binary file not shown.
11 changes: 11 additions & 0 deletions i3dm.export.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "i3dm.export.tests", "tests\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "i3dm.export", "src\i3dm.export.csproj", "{D4272C32-52DC-421C-B8C9-4B56450A0297}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{FDA4529B-E5E1-4FAF-B61D-0E84B584165A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{209D3C56-880E-4504-8BED-8D80C46584E3}"
ProjectSection(SolutionItems) = preProject
.github\workflows\main.yml = .github\workflows\main.yml
release.yml = release.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -34,6 +42,9 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{209D3C56-880E-4504-8BED-8D80C46584E3} = {FDA4529B-E5E1-4FAF-B61D-0E84B584165A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {63914EC0-30CB-434B-A3D1-D1F80F413BE4}
EndGlobalSection
Expand Down
79 changes: 79 additions & 0 deletions release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Publish

permissions:
contents: write

on:
push:
tags:
- v*

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Build
run: echo ${{ github.sha }} > Release.txt
- name: Test
run: cat Release.txt

- name: Build and publish
run: |
architectures=(win-x64 osx-x64 linux-x64 win-arm64 osx-arm64 linux-arm64)
for arch in "${architectures[@]}"; do
dotnet publish src -c Release -r "$arch" /p:PublishSingleFile=true
cd src/bin/Release/net8.0/"$arch"/publish
zip -r ../../../../../../i3dm.export-"$arch".zip *
cd ../../../../../..
done
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
Release.txt
i3dm.export-win-x64.zip
i3dm.export-win-arm64.zip
i3dm.export-osx-x64.zip
i3dm.export-osx-arm64.zip
i3dm.export-linux-x64.zip
i3dm.export-linux-arm64.zip
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
with:
strip_v: true

- name: Pack
working-directory: src
run: |
dotnet build i3dm.export.csproj --configuration Release
dotnet pack i3dm.export.csproj --configuration Release -p:PackAsTool=true --output ./nupkg
- name: Publish to NuGet
working-directory: src
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push ./nupkg/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Publish
run: |
docker build ./src --file Dockerfile --tag geodan/i3dm.export:latest
docker push geodan/i3dm.export:latest
docker tag geodan/i3dm.export:latest geodan/i3dm.export:${{ steps.tag.outputs.tag }}
docker push geodan/i3dm.export:${{ steps.tag.outputs.tag }}
12 changes: 6 additions & 6 deletions src/i3dm.export.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ToolCommandName>i3dm.export</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>
<Version>2.7.4</Version>
<AssemblyVersion>2.7.4</AssemblyVersion>
<FileVersion>2.7.4</FileVersion>
<Version>2.8.0</Version>
<AssemblyVersion>2.8.0</AssemblyVersion>
<FileVersion>2.8.0</FileVersion>
<PackageProjectUrl>https://github.com/geodan/i3dm.export</PackageProjectUrl>
<RepositoryUrl>https://github.com/geodan/i3dm.export</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand All @@ -28,8 +28,8 @@
<PackageReference Include="i3dm.tile" Version="1.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Npgsql" Version="8.0.3" />
<PackageReference Include="SharpGLTF.Ext.3DTiles" Version="1.0.0" />
<PackageReference Include="SharpGLTF.Toolkit" Version="1.0.0" />
<PackageReference Include="SharpGLTF.Ext.3DTiles" Version="1.0.1" />
<PackageReference Include="SharpGLTF.Toolkit" Version="1.0.1" />
<PackageReference Include="ShellProgressBar" Version="5.2.0" />
<PackageReference Include="subtree" Version="1.4.7" />
<PackageReference Include="Wkx" Version="0.5.1" />
Expand Down
2 changes: 1 addition & 1 deletion tests/i3dm.export.tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down

0 comments on commit afb2747

Please sign in to comment.