diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..4b698ba --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,77 @@ +name: Publish Nuget Packages + +on: + push: + tags: + - '*.*.**' +jobs: + publish_nuget_package: + name: Publish SSync Client + runs-on: ubuntu-latest + steps: + + - name: Setup .NET + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 8.0.x + +# project ssync client + + - uses: actions/checkout@v4 + - name: Set Version Client + run: | + set -i -e 's/{{Version}}/${{github.ref_name}}/' ./src.SSync.Client.LitebDB/SSync.Client.LitebDB.csproj + + - name: Restore Client + run: dotnet restore ./src.SSync.Client.LitebDB/SSync.Client.LitebDB.csproj + + - name: Build Client + run: dotnet build --no-restore ./src.SSync.Client.LitebDB/SSync.Client.LitebDB.csproj + + + - name: Test Client + run: dotnet test --no-build --verbosity normal ./src.SSync.Client.LitebDB/SSync.Client.LitebDB.csproj + + - name: Pack Client + run: | + dotnet pack ./src.SSync.Client.LitebDB/SSync.Client.LitebDB.csproj -c Release -o .output-client + + + # - name: Publish Client + # env: + # API_KEY: ${{ secrets.NUGET_API_KEY_CLIENT }} + # run: | + # dotnet nuget push output-client/*.nupkg --api-key $API_KEY --source -s https://api.nuget.org/v3/index.json --skip-duplicate + +# end project ssync client + +# project ssync server + + - uses: actions/checkout@v4 + - name: Set Version Server + run: | + set -i -e 's/{{Version}}/${{github.ref_name}}/' ./src.SSync.Server.LitebDB/SSync.Server.LitebDB.csproj + + - name: Restore Server + run: dotnet restore ./src.SSync.Server.LitebDB/SSync.Server.LitebDB.csproj + + - name: Build Server + run: dotnet build --no-restore ./src.SSync.Server.LitebDB/SSync.Server.LitebDB.csproj + + + - name: Test Server + run: dotnet test --no-build --verbosity normal ./src.SSync.Server.LitebDB/SSync.Server.LitebDB.csproj + + - name: Pack Server + run: | + dotnet pack ./src.SSync.Server.LitebDB/SSync.Server.LitebDB.csproj -c Release -o .output-server + + + # - name: Publish Server + # env: + # API_KEY: ${{ secrets.NUGET_API_KEY_SERVER }} + # run: | + # dotnet nuget push output-server/*.nupkg --api-key $API_KEY --source -s https://api.nuget.org/v3/index.json --skip-duplicate + +# end project ssync server + \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index e69de29..0000000 diff --git a/SSync.LiteDB.sln b/SSync.LiteDB.sln index ef65f33..720cb18 100644 --- a/SSync.LiteDB.sln +++ b/SSync.LiteDB.sln @@ -25,8 +25,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SSync.Server.LitebDB.Tests" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{36F96630-08DF-4386-AADB-C8E121988D5B}" ProjectSection(SolutionItems) = preProject - .github\workflows\publish.yml = .github\workflows\publish.yml readme.md = readme.md + .github\workflows\publish.yaml = .github\workflows\publish.yaml EndProjectSection EndProject Global diff --git a/src/SSync.Client.LitebDB/SSync.Client.LitebDB.csproj b/src/SSync.Client.LitebDB/SSync.Client.LitebDB.csproj index 8014521..e793c8c 100644 --- a/src/SSync.Client.LitebDB/SSync.Client.LitebDB.csproj +++ b/src/SSync.Client.LitebDB/SSync.Client.LitebDB.csproj @@ -6,7 +6,7 @@ enable SSync.Client.LitebDB - 1.0.0-alpha.1 + {{Version}} Gabriel Sales MIT MIT diff --git a/src/SSync.Server.LitebDB/SSync.Server.LitebDB.csproj b/src/SSync.Server.LitebDB/SSync.Server.LitebDB.csproj index 229f51b..f18a1a9 100644 --- a/src/SSync.Server.LitebDB/SSync.Server.LitebDB.csproj +++ b/src/SSync.Server.LitebDB/SSync.Server.LitebDB.csproj @@ -8,7 +8,7 @@ SSync.Server.LitebDB - 1.0.0-alpha.1 + {{Version}} Gabriel Sales MIT MIT