diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5985bfb..724ca7d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,10 +1,12 @@ name: .NET -on: push - +on: + push: + branches: [ '**' ] + pull_request: + branches: [ '**' ] jobs: build: - runs-on: ubuntu-latest steps: @@ -12,26 +14,10 @@ jobs: - 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 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 2f8658c..619c76f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] \ No newline at end of file diff --git a/README.md b/README.md index b9ae3c9..75d0081 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/docs/getting_started.md b/docs/getting_started.md index 1232d12..9be4e8f 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -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 ``` @@ -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 diff --git a/i3dm.export-win-x64.zip b/i3dm.export-win-x64.zip new file mode 100644 index 0000000..3c77a4f Binary files /dev/null and b/i3dm.export-win-x64.zip differ diff --git a/i3dm.export.sln b/i3dm.export.sln index dda68ec..c5e4032 100644 --- a/i3dm.export.sln +++ b/i3dm.export.sln @@ -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 @@ -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 diff --git a/release.yml b/release.yml new file mode 100644 index 0000000..8f8bc4b --- /dev/null +++ b/release.yml @@ -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 }} + diff --git a/src/i3dm.export.csproj b/src/i3dm.export.csproj index e75c3d1..feca286 100644 --- a/src/i3dm.export.csproj +++ b/src/i3dm.export.csproj @@ -2,12 +2,12 @@ Exe - net6.0 + net8.0 i3dm.export ./nupkg - 2.7.4 - 2.7.4 - 2.7.4 + 2.8.0 + 2.8.0 + 2.8.0 https://github.com/geodan/i3dm.export https://github.com/geodan/i3dm.export git @@ -28,8 +28,8 @@ - - + + diff --git a/tests/i3dm.export.tests.csproj b/tests/i3dm.export.tests.csproj index 39227ed..40cb858 100644 --- a/tests/i3dm.export.tests.csproj +++ b/tests/i3dm.export.tests.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 false