diff --git a/.github/workflows/release-upload-zip.yml b/.github/workflows/release-upload-zip.yml
index 4dcf1c3..f35bd64 100644
--- a/.github/workflows/release-upload-zip.yml
+++ b/.github/workflows/release-upload-zip.yml
@@ -1,11 +1,9 @@
name: Release - Upload ZIP
on:
- pull_request:
- branches:
- - main
- types:
- - closed
+ push:
+ tags:
+ - 'v*' # v1.3.0.0 など
permissions:
contents: write
@@ -15,85 +13,46 @@ env:
jobs:
release:
- # 通常のマージでのみ動作することを想定
- if: github.event.pull_request.merged == true
- runs-on: windows-latest # 安定した最新のWindows環境
+ runs-on: windows-2025-vs2026
steps:
- name: Checkout
uses: actions/checkout@v4
- with:
- # マージコミットではなく、ソースブランチのHEADを一時的に見るか、全履歴を取得
- fetch-depth: 0
-
- - name: Resolve tag from source branch (v*)
- id: tag_check
- shell: pwsh
- run: |
- git fetch --tags --force
- $headSha = '${{ github.event.pull_request.head.sha }}'
- $baseSha = '${{ github.event.pull_request.base.sha }}'
-
- $selectedTag = git describe --tags --match 'v*' --abbrev=0 $headSha 2>$null
- if (-not $selectedTag) {
- Write-Error "No reachable v* tag found from source branch head commit: $headSha"
- exit 1
- }
-
- $tagCommit = git rev-list -n 1 $selectedTag
-
- # 初期値を設定
- $shouldRelease = "true"
-
- git merge-base --is-ancestor $tagCommit $baseSha
- if ($LASTEXITCODE -eq 0) {
- $shouldRelease = "false"
- Write-Host "Tag $selectedTag already existed on main side before merge. Skipping release flow."
- }
-
- # GitHubの環境変数とステップ出力に保存
- "SHOULD_RELEASE=$shouldRelease" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- "RELEASE_TAG=$selectedTag" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- Write-Host "Using tag: $selectedTag"
- name: Setup .NET
- if: env.SHOULD_RELEASE == 'true'
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Setup MSBuild
- if: env.SHOULD_RELEASE == 'true'
uses: microsoft/setup-msbuild@v2
+ with:
+ vs-version: '17.0'
+ # packages.config 対応
- name: NuGet Restore
- if: env.SHOULD_RELEASE == 'true'
run: nuget restore SampleCSharpBulkRAGReg.sln
- name: Build (Release)
- if: env.SHOULD_RELEASE == 'true'
- run: |
- msbuild SampleCSharpBulkRAGReg.sln `
- /p:Configuration=Release `
- /p:Platform="Any CPU" `
- /t:Build
+ run: msbuild SampleCSharpBulkRAGReg.sln `
+ /p:Configuration=Release `
+ /p:Platform="Any CPU" `
+ /t:Build
+ # ZIP 作成(タグ名を使用)
- name: Create ZIP
- if: env.SHOULD_RELEASE == 'true'
run: |
Compress-Archive `
-Path SampleCSharpBulkRAGReg/bin/Release/* `
- -DestinationPath SampleCSharpBulkRAGReg-${{ env.RELEASE_TAG }}.zip
+ -DestinationPath SampleCSharpBulkRAGReg-${{ github.ref_name }}.zip
- # 非推奨アクションを最新の定番アクションに統合
- - name: Create and Upload GitHub Release
- if: env.SHOULD_RELEASE == 'true'
- uses: softprops/action-gh-release@v2
+ # Release を作成または更新し、ZIP を添付
+ - name: Create or Update Release and Upload ZIP
+ uses: softprops/action-gh-release@v3
with:
- tag_name: ${{ env.RELEASE_TAG }}
- name: Release ${{ env.RELEASE_TAG }}
+ tag_name: ${{ github.ref_name }}
+ name: Release ${{ github.ref_name }}
draft: false
prerelease: false
- files: SampleCSharpBulkRAGReg-${{ env.RELEASE_TAG }}.zip
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file
+ overwrite_files: true
+ files: SampleCSharpBulkRAGReg-${{ github.ref_name }}.zip
\ No newline at end of file
diff --git a/SampleCSharpBulkRAGReg/Properties/AssemblyInfo.cs b/SampleCSharpBulkRAGReg/Properties/AssemblyInfo.cs
index c5edf9b..a24c36f 100644
--- a/SampleCSharpBulkRAGReg/Properties/AssemblyInfo.cs
+++ b/SampleCSharpBulkRAGReg/Properties/AssemblyInfo.cs
@@ -48,5 +48,5 @@
// ビルド番号
// リビジョン
//
-[assembly: AssemblyVersion("1.1.0.0")]
-[assembly: AssemblyFileVersion("1.1.0.0")]
+[assembly: AssemblyVersion("1.1.1.0")]
+[assembly: AssemblyFileVersion("1.1.1.0")]
diff --git a/SampleCSharpBulkRAGReg/SampleCSharpBulkRAGReg.csproj b/SampleCSharpBulkRAGReg/SampleCSharpBulkRAGReg.csproj
index 8fd7006..414f79c 100644
--- a/SampleCSharpBulkRAGReg/SampleCSharpBulkRAGReg.csproj
+++ b/SampleCSharpBulkRAGReg/SampleCSharpBulkRAGReg.csproj
@@ -67,8 +67,8 @@
..\packages\Microsoft.Extensions.Logging.Abstractions.10.0.8\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll
-
- ..\packages\Microsoft.Identity.Client.4.79.2\lib\net472\Microsoft.Identity.Client.dll
+
+ ..\packages\Microsoft.Identity.Client.4.81.0\lib\net472\Microsoft.Identity.Client.dll
..\packages\Microsoft.IdentityModel.Abstractions.8.18.0\lib\net472\Microsoft.IdentityModel.Abstractions.dll
diff --git a/SampleCSharpBulkRAGReg/packages.config b/SampleCSharpBulkRAGReg/packages.config
index 0339fb5..299e62b 100644
--- a/SampleCSharpBulkRAGReg/packages.config
+++ b/SampleCSharpBulkRAGReg/packages.config
@@ -4,7 +4,7 @@
-
+