diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index ae6b7e63..070c7cbd 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -8,6 +8,7 @@ on: branches: [ "master" ] pull_request: branches: [ "master" ] + types: ["opened", "reopened", "synchronize", "ready_for_review", "auto_merge_enabled"] jobs: windows: @@ -24,8 +25,8 @@ jobs: run: dotnet restore - name: Build CPU version run: dotnet build --no-restore -# - name: Test CPU version -# run: dotnet test --no-build --verbosity normal + - name: Test CPU version + run: dotnet test --no-build --verbosity normal - name: uninstall redist cpu for unit tests run: dotnet remove helpers/Tensorflow.UnitTest.RedistHolder package SciSharp.TensorFlow.Redist - name: install redist gpu for unit tests @@ -51,8 +52,8 @@ jobs: run: dotnet restore - name: Build CPU version run: dotnet build --no-restore -# - name: Test CPU version -# run: dotnet test --no-build --verbosity normal + # - name: Test CPU version + # run: dotnet test --no-build --verbosity normal - name: uninstall redist cpu for unit tests run: dotnet remove helpers/Tensorflow.UnitTest.RedistHolder package SciSharp.TensorFlow.Redist - name: install redist gpu for unit tests diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5afef6f2..977e340e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,6 @@ -name: release +name: auto-release -on: +on: workflow_run: workflows: ["build_and_test"] types: @@ -12,6 +12,7 @@ env: jobs: build: + if: ${{ github.event.label.name == 'auto-release'}} runs-on: windows-latest steps: @@ -67,7 +68,8 @@ jobs: - name: Pack packages run: | - $LastTag = git describe --tags (git rev-list --tags --max-count=1); + git fetch; + $LastTag = git describe --tags; echo "Last tag is: $LastTag"; $Version = ($LastTag).TrimStart('v'); echo "Publishing version: $Version"; @@ -88,5 +90,11 @@ jobs: - name: Add myget nuget source run: dotnet nuget add source https://www.myget.org/F/rinne/api/v2/package --name myget.org - - name: Push packages to myget.org - run: dotnet nuget push .\packages\TensorFlow*.nupkg -s myget.org -k $env:MYGET_API_TOKEN --skip-duplicate + - name: Push TensorFlow.NET to myget.org + run: dotnet nuget push .\packages\TensorFlow.NET.nupkg -s myget.org -k $env:MYGET_API_TOKEN --skip-duplicate + + - name: Push TensorFlow.Keras to myget.org + run: dotnet nuget push .\packages\TensorFlow.Keras.nupkg -s myget.org -k $env:MYGET_API_TOKEN --skip-duplicate + + - name: Push TensorFlow.Hub to myget.org + run: dotnet nuget push .\packages\TensorFlow.Hub.nupkg -s myget.org -k $env:MYGET_API_TOKEN --skip-duplicate diff --git a/src/TensorflowNET.Hub/Tensorflow.Hub.csproj b/src/TensorflowNET.Hub/Tensorflow.Hub.csproj index fef8b34f..1e688ac9 100644 --- a/src/TensorflowNET.Hub/Tensorflow.Hub.csproj +++ b/src/TensorflowNET.Hub/Tensorflow.Hub.csproj @@ -5,7 +5,7 @@ 10 enable 1.0.0 - TensorFlow.NET.Hub + TensorFlow.Hub Apache2.0 true true diff --git a/test/TensorFlowNET.Keras.UnitTest/Layers/ActivationTest.cs b/test/TensorFlowNET.Keras.UnitTest/Layers/ActivationTest.cs index 75fcc023..cc99f4a0 100644 --- a/test/TensorFlowNET.Keras.UnitTest/Layers/ActivationTest.cs +++ b/test/TensorFlowNET.Keras.UnitTest/Layers/ActivationTest.cs @@ -49,7 +49,7 @@ namespace Tensorflow.Keras.UnitTest.Layers Tensor input = tf.constant(new float[] { -3f, -2f, -1f, 0f, 1f, 2f }); Tensor output = keras.layers.Softplus().Apply(input); NDArray expected = new NDArray(new float[] { 0.04858733f, 0.12692805f, 0.31326166f, 0.6931472f, 1.3132616f, 2.126928f }); - Assert.AreEqual(expected, output.numpy()); + Assert.IsTrue(expected == output.numpy()); } [TestMethod] diff --git a/test/TensorFlowNET.Keras.UnitTest/Layers/AttentionTest.cs b/test/TensorFlowNET.Keras.UnitTest/Layers/AttentionTest.cs index 162a10d2..95ef923e 100644 --- a/test/TensorFlowNET.Keras.UnitTest/Layers/AttentionTest.cs +++ b/test/TensorFlowNET.Keras.UnitTest/Layers/AttentionTest.cs @@ -94,7 +94,7 @@ namespace Tensorflow.Keras.UnitTest.Layers { 7.6400003f, 12.24f, 16.84f }, { 14.24f, 22.84f, 31.439999f } } }, dtype: np.float32); - Assert.AreEqual(expected, actual.numpy()); + Assert.IsTrue(expected == actual.numpy()); } [TestMethod] diff --git a/test/TensorFlowNET.Keras.UnitTest/Losses/LossesTest.cs b/test/TensorFlowNET.Keras.UnitTest/Losses/LossesTest.cs index 3bec2f17..0bb1d011 100644 --- a/test/TensorFlowNET.Keras.UnitTest/Losses/LossesTest.cs +++ b/test/TensorFlowNET.Keras.UnitTest/Losses/LossesTest.cs @@ -39,7 +39,7 @@ public class LossesTest : EagerModeTestBase // Using 'none' reduction type. bce = tf.keras.losses.BinaryCrossentropy(from_logits: true, reduction: Reduction.NONE); loss = bce.Call(y_true, y_pred); - Assert.AreEqual(new float[] { 0.23515666f, 1.4957594f }, loss.numpy()); + Assert.IsTrue(new NDArray(new float[] { 0.23515666f, 1.4957594f }) == loss.numpy()); } ///