From b97ea9115494c5317f8f01403385dac586fac982 Mon Sep 17 00:00:00 2001 From: actbit <57023457+actbit@users.noreply.github.com> Date: Sat, 28 Feb 2026 18:44:52 +0900 Subject: [PATCH 1/4] [add] LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c869c8b --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 actbit + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 6fec67f0bb946bbe611dbb5febee843bdcdefd50 Mon Sep 17 00:00:00 2001 From: actbit <57023457+actbit@users.noreply.github.com> Date: Sat, 28 Feb 2026 18:46:57 +0900 Subject: [PATCH 2/4] [add] nuget publish --- .github/workflows/nuget-publish.yml | 81 +++++++++++++++++++ .../MaskedUUID.AspNetCore.csproj | 16 ++++ 2 files changed, 97 insertions(+) create mode 100644 .github/workflows/nuget-publish.yml diff --git a/.github/workflows/nuget-publish.yml b/.github/workflows/nuget-publish.yml new file mode 100644 index 0000000..2079f67 --- /dev/null +++ b/.github/workflows/nuget-publish.yml @@ -0,0 +1,81 @@ +name: Publish to NuGet + +on: + push: + branches: [ release ] + workflow_dispatch: + +jobs: + build-and-publish: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # タグ取得用 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 9.0.x + 10.0.x + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release --no-restore + + - name: Test + run: dotnet test --configuration Release --no-build --verbosity normal + + - name: Calculate Version + id: version + run: | + # csprojからVersionPrefixを取得 + VERSION_PREFIX=$(grep -oP '(?<=)[^<]+' src/MaskedUUID.AspNetCore/MaskedUUID.AspNetCore.csproj) + echo "VersionPrefix: $VERSION_PREFIX" + + # 前回のタグを取得 + PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") + + if [ -z "$PREV_TAG" ]; then + # タグがない場合は初回リリース + VERSION="${VERSION_PREFIX}.0" + else + # 前回タグからx.yを抽出 + PREV_XY=$(echo $PREV_TAG | sed 's/^v//' | cut -d. -f1,2) + PREV_Z=$(echo $PREV_TAG | sed 's/^v//' | cut -d. -f3) + + if [ "$PREV_XY" = "$VERSION_PREFIX" ]; then + # 同じx.yならzをインクリメント + NEW_Z=$((PREV_Z + 1)) + VERSION="${VERSION_PREFIX}.${NEW_Z}" + else + # 異なるx.yならz=0 + VERSION="${VERSION_PREFIX}.0" + fi + fi + + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "Package Version: $VERSION" + + - name: Pack + run: dotnet pack src/MaskedUUID.AspNetCore/MaskedUUID.AspNetCore.csproj + --configuration Release + --output ./nupkg + /p:PackageVersion=${{ steps.version.outputs.version }} + + - name: Publish to NuGet + run: dotnet nuget push ./nupkg/*.nupkg + --api-key ${{ secrets.NUGET_API_KEY }} + --source https://api.nuget.org/v3/index.json + --skip-duplicate + + - name: Create Git Tag + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git tag v${{ steps.version.outputs.version }} + git push origin v${{ steps.version.outputs.version }} diff --git a/src/MaskedUUID.AspNetCore/MaskedUUID.AspNetCore.csproj b/src/MaskedUUID.AspNetCore/MaskedUUID.AspNetCore.csproj index e824bd3..a69a6ca 100644 --- a/src/MaskedUUID.AspNetCore/MaskedUUID.AspNetCore.csproj +++ b/src/MaskedUUID.AspNetCore/MaskedUUID.AspNetCore.csproj @@ -17,6 +17,22 @@ enable enable Library + true + + + MaskedUUID.AspNetCore + 1.0 + actbit + ASP.NET Core で UUIDv7 のタイムスタンプ部を UUIDv47 アルゴリズムでマスクし、可逆的に変換するライブラリ + uuid;uuidv7;uuidv47;aspnetcore;masking + MIT + README.md + https://github.com/actbit/MaskedUUID + git + + + + From 60cc5903d7c5f0f8a9c262a8c2250a072a5602c7 Mon Sep 17 00:00:00 2001 From: actbit <57023457+actbit@users.noreply.github.com> Date: Sat, 28 Feb 2026 18:49:16 +0900 Subject: [PATCH 3/4] [add] ci --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8ae476c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,30 @@ +name: CI + +on: + push: + branches: [ master, feature/** ] + pull_request: + branches: [ master ] + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 9.0.x + 10.0.x + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release --no-restore + + - name: Test + run: dotnet test --configuration Release --no-build --verbosity normal From a9042dccc4c960a6522479de9139172c5a395f36 Mon Sep 17 00:00:00 2001 From: actbit <57023457+actbit@users.noreply.github.com> Date: Sat, 28 Feb 2026 18:51:38 +0900 Subject: [PATCH 4/4] [fix] ci --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ae476c..46693b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,10 @@ jobs: run: dotnet restore - name: Build - run: dotnet build --configuration Release --no-restore + run: dotnet build src/MaskedUUID.AspNetCore/MaskedUUID.AspNetCore.csproj --configuration Release --no-restore + + - name: Build Tests + run: dotnet build tests/MaskedUUID.AspNetCore.Tests/MaskedUUID.AspNetCore.Tests.csproj --configuration Release --no-restore - name: Test - run: dotnet test --configuration Release --no-build --verbosity normal + run: dotnet test tests/MaskedUUID.AspNetCore.Tests/MaskedUUID.AspNetCore.Tests.csproj --configuration Release --no-build --verbosity normal