From 78934868e918678870d1f94510737b2e885d5b06 Mon Sep 17 00:00:00 2001 From: Daan Verstraten Date: Wed, 21 Jun 2023 10:52:49 +0200 Subject: [PATCH 01/11] Update Library.csproj --- Library/Library.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Library.csproj b/Library/Library.csproj index d61c993..57b33e3 100644 --- a/Library/Library.csproj +++ b/Library/Library.csproj @@ -7,7 +7,7 @@ DaanV2.NBT.Net DaanV2.NBT True - DaanV2.UUID.Net + DaanV2.NBT.Net DaanV2 daanverstraten@hotmail.com $(VersionPrefix) @@ -15,7 +15,7 @@ 2.0.0 AnyCPU;x64;x86 False - An NBT library for reading and writing NBT files/data + An NBT library for reading and writing NBT files, support Minecraft java and bedrock nbt/data https://github.com/DaanV2/DaanV2.NBT.Net icon.png README.md From 5532a6056d3bf3c84897faf99fe65725b7a9d24f Mon Sep 17 00:00:00 2001 From: Daan Verstraten Date: Wed, 21 Jun 2023 10:53:27 +0200 Subject: [PATCH 02/11] Update auto-generated.yml --- .github/workflows/auto-generated.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-generated.yml b/.github/workflows/auto-generated.yml index 774e8c1..02108b1 100644 --- a/.github/workflows/auto-generated.yml +++ b/.github/workflows/auto-generated.yml @@ -40,10 +40,10 @@ jobs: continue-on-error: true run: | cd $GITHUB_WORKSPACE - git config --global user.email "github-action@github.com" + git config --global user.email "actions@github.com" git config --global user.name "github" git add . - git commit -m "auto: Generated Readmes" + git commit -m "auto: Generated Readmes" || echo "No changes to commit" - name: 🚚 Push continue-on-error: true From 8164a1c97f2a35ea28a59e4cb3927cada7669912 Mon Sep 17 00:00:00 2001 From: Daan Verstraten Date: Wed, 21 Jun 2023 10:53:35 +0200 Subject: [PATCH 03/11] Update dotnet-test.yml --- .github/workflows/dotnet-test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet-test.yml b/.github/workflows/dotnet-test.yml index 3fe3d3e..7428cf0 100644 --- a/.github/workflows/dotnet-test.yml +++ b/.github/workflows/dotnet-test.yml @@ -1,8 +1,9 @@ -name: .NET 📋 Unit test +name: 📋 .NET Unit test on: push: - branches: [ "main" ] + branches: + - main pull_request: concurrency: From 337aabb097469fee79214b19e67abd4f1b9087d7 Mon Sep 17 00:00:00 2001 From: Daan Verstraten Date: Wed, 21 Jun 2023 10:53:47 +0200 Subject: [PATCH 04/11] Update publish.yml --- .github/workflows/publish.yml | 51 ++++++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cc5fb53..fbf5fc5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,9 +1,9 @@ name: 📦 Nuget Release on: - release: - types: [created] - workflow_dispatch: {} + push: + tags: + - '*' concurrency: group: publish-${{ github.ref }} @@ -13,22 +13,62 @@ env: NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} jobs: + update-version: + name: 📝 Update version + runs-on: ubuntu-latest + outputs: + tag_name: ${{ steps.tag.outputs.tag_name }} + steps: + - name: 📦 Checkout repository + uses: actions/checkout@v3 + with: + ref: main + + - name: 🔍 Get Tag + id: tag + run: echo "tag_name=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT" + + - name: 🖊️ Update version in .csproj files + run: | + TAG=${{ steps.tag.outputs.tag_name }} + find . -name '*.csproj' -type f -exec sed -i "s/.*<\/Version>/${TAG//v}<\/Version>/g" {} \; + + - name: 📋 Commit changes + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add . + git commit -m "auto: Update version to ${{ steps.tag.outputs.tag_name }}" || echo "No changes to commit" + + - name: 🚚 Push changes + continue-on-error: true + run: git push + + - name: 🖊️ Job summary + run: | + echo "Tag name: ${{ steps.tag.outputs.tag_name }}" >> $GITHUB_STEP_SUMMARY + build: + name: 🛠️ Build runs-on: windows-latest + needs: update-version permissions: packages: write contents: read environment: name: Nuget Release - url: https://www.nuget.org/packages/DaanV2.NBT.Net/ + url: https://www.nuget.org/packages/DaanV2.UUID.Net/ steps: - name: 📦 Checkout repository uses: actions/checkout@v3 + with: + ref: main - name: 🛠️ Setup .NET uses: actions/setup-dotnet@v3 with: dotnet-version: 7.0.x + cache: true source-url: https://nuget.pkg.github.com/DaanV2/index.json - name: 📥 Restore dependencies @@ -43,8 +83,7 @@ jobs: - name: 📦 Create the package run: dotnet pack --configuration Release Library - - name: 🚚 Publish the package to GPR + - name: 🚚 Publish the package to Nuget run: | cd ${{ github.workspace }}/Library/bin/Release/ - dotnet nuget push *.nupkg dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json From e181ddde5cdd8782738df859ec9477387a02e3af Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 21 Jun 2023 08:54:26 +0000 Subject: [PATCH 05/11] auto: Update version to v2.0.1 --- Library/Library.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Library.csproj b/Library/Library.csproj index 57b33e3..6bf136d 100644 --- a/Library/Library.csproj +++ b/Library/Library.csproj @@ -12,7 +12,7 @@ daanverstraten@hotmail.com $(VersionPrefix) $(VersionPrefix) - 2.0.0 + 2.0.1 AnyCPU;x64;x86 False An NBT library for reading and writing NBT files, support Minecraft java and bedrock nbt/data From 2a5484681b8a6bb2c5afc2c704d65a4abade6124 Mon Sep 17 00:00:00 2001 From: Daan Verstraten Date: Wed, 21 Jun 2023 10:57:33 +0200 Subject: [PATCH 06/11] Update publish.yml --- .github/workflows/publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fbf5fc5..316b7e7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -69,7 +69,6 @@ jobs: with: dotnet-version: 7.0.x cache: true - source-url: https://nuget.pkg.github.com/DaanV2/index.json - name: 📥 Restore dependencies run: dotnet restore --verbosity normal From a292c0c9208ede37b9d369ec71f33305ccc4bd77 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 21 Jun 2023 08:58:19 +0000 Subject: [PATCH 07/11] auto: Update version to v2.0.2 --- Library/Library.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Library.csproj b/Library/Library.csproj index 6bf136d..d075727 100644 --- a/Library/Library.csproj +++ b/Library/Library.csproj @@ -12,7 +12,7 @@ daanverstraten@hotmail.com $(VersionPrefix) $(VersionPrefix) - 2.0.1 + 2.0.2 AnyCPU;x64;x86 False An NBT library for reading and writing NBT files, support Minecraft java and bedrock nbt/data From 089ada5b62d6baa4965e7af3c9ec95118653c2fa Mon Sep 17 00:00:00 2001 From: Daan Verstraten Date: Thu, 22 Jun 2023 10:44:06 +0200 Subject: [PATCH 08/11] Cleaned --- .vscode/launch.json | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index bb45643..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - // Use IntelliSense to find out which attributes exist for C# debugging - // Use hover for the description of the existing attributes - // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md - "name": ".NET Core Launch (console)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/Benchmark/bin/Debug/net7.0/Benchmark.dll", - "args": [], - "cwd": "${workspaceFolder}/Benchmark", - // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console - "console": "internalConsole", - "stopAtEntry": false - }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach" - } - ] -} \ No newline at end of file From bd4c2d7c36d21d5509110eafb6bc4ceeca92801a Mon Sep 17 00:00:00 2001 From: Daan Verstraten Date: Thu, 22 Jun 2023 10:48:42 +0200 Subject: [PATCH 09/11] Update publish.yml --- .github/workflows/publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 316b7e7..88a8bd2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -68,7 +68,6 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: 7.0.x - cache: true - name: 📥 Restore dependencies run: dotnet restore --verbosity normal From d590d0f7da317eacd89629b43fc1f650aba83d3d Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 22 Jun 2023 08:49:08 +0000 Subject: [PATCH 10/11] auto: Update version to v2.0.3 --- Library/Library.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Library.csproj b/Library/Library.csproj index d075727..179659c 100644 --- a/Library/Library.csproj +++ b/Library/Library.csproj @@ -12,7 +12,7 @@ daanverstraten@hotmail.com $(VersionPrefix) $(VersionPrefix) - 2.0.2 + 2.0.3 AnyCPU;x64;x86 False An NBT library for reading and writing NBT files, support Minecraft java and bedrock nbt/data From ba9e2d56000d3da57de4b51d455381d9fe94b8da Mon Sep 17 00:00:00 2001 From: Daan Verstraten Date: Thu, 22 Jun 2023 10:56:38 +0200 Subject: [PATCH 11/11] Update publish.yml --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 88a8bd2..555d154 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -57,7 +57,7 @@ jobs: contents: read environment: name: Nuget Release - url: https://www.nuget.org/packages/DaanV2.UUID.Net/ + url: https://www.nuget.org/packages/DaanV2.NBT.Net/ steps: - name: 📦 Checkout repository uses: actions/checkout@v3