diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..d5d64d9 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,47 @@ +name: Build +run-name: Build ${{ github.event.repository.name }} for ${{ github.actor }} +on: [ push, pull_request ] +env: + TERM: xterm + DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: true + DOTNET_CONSOLE_ANSI_COLOR: true + DOTNET_CLI_TELEMETRY_OPTOUT: true + +jobs: + Build: + runs-on: [ ubuntu-latest ] + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 9.0.x + cache: true + cache-dependency-path: Directory.Packages.props + - name: Restore + run: dotnet restore Atomorph.NET.sln --nologo --verbosity quiet + - name: Determine version + run: | + if [[ "$GITHUB_REF" == refs/tags/v* ]]; then + VERSION="${GITHUB_REF_NAME#v}" + else + VERSION="0.1.0-ci.${GITHUB_RUN_NUMBER}" + fi + echo "VERSION=$VERSION" >> "$GITHUB_ENV" + - name: Build + run: dotnet build Atomorph.NET.sln -c Release --nologo --no-restore --verbosity quiet -p:Version=$VERSION + - name: Pack + if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) + run: dotnet pack Atomorph.NET.sln -c Release --nologo --no-restore --no-build -p:Version=$VERSION -o ./packages + # Needs a personal access token with write:package scope: Gitea's automatic Actions token + # only ever gets read access to the package registry, so pushing with it returns 401. + - name: Publish to Gitea NuGet feed + if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) + run: > + dotnet nuget push "./packages/*.nupkg" + --source "${{ github.server_url }}/api/packages/${{ github.repository_owner }}/nuget/index.json" + --api-key "${{ secrets.PACKAGES_TOKEN }}" + --skip-duplicate diff --git a/Atomorph.NET.Demo/Atomorph.NET.Demo.csproj b/Atomorph.NET.Demo/Atomorph.NET.Demo.csproj index 83cc6ee..9e168fd 100644 --- a/Atomorph.NET.Demo/Atomorph.NET.Demo.csproj +++ b/Atomorph.NET.Demo/Atomorph.NET.Demo.csproj @@ -5,6 +5,7 @@ net9.0 enable enable + false diff --git a/Atomorph.NET/Atomorph.NET.csproj b/Atomorph.NET/Atomorph.NET.csproj index 88a01a3..00a1176 100644 --- a/Atomorph.NET/Atomorph.NET.csproj +++ b/Atomorph.NET/Atomorph.NET.csproj @@ -7,6 +7,17 @@ Atomorph + + Image morphing library that uses fluid dynamics and optimal transport to produce intuitive morphs. + MIT + README.md + https://git.p-epsilon.com/Deukhoofd/Atomorph.NET + + + + + + diff --git a/Directory.Build.props b/Directory.Build.props index d713a3b..149bb70 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -10,8 +10,15 @@ enable + + 0.1.0 + Deukhoofd + https://git.p-epsilon.com/Deukhoofd/Atomorph.NET + git + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive