From 989a8f47eade14df490ed7213ad2c9e48afb4cd2 Mon Sep 17 00:00:00 2001 From: Akimitsu Inoue Date: Thu, 6 Jun 2024 16:52:44 +0900 Subject: [PATCH 01/19] Update README-ja.md file with improved clarity and attractiveness. --- README-ja.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README-ja.md b/README-ja.md index 4d6d583..f64d183 100644 --- a/README-ja.md +++ b/README-ja.md @@ -2,17 +2,17 @@ ## 概要 -**ExcelAgentTemplate** は、Microsoft ExcelとPythonを組み合わせた強力なアドインです。このツールを使用することで、Excelの関数を介して最新の LLM (Large Language Models) を活用し、自動化されたエージェントを実行することができます。ユーザーはExcelのセルに特定のプロンプトを記入するだけで、LLMを活用した複雑なクエリやデータ処理タスクを簡単に実行することが可能になります。 +**ExcelAgentTemplate** は、Microsoft ExcelとPythonを組み合わせた強力なアドインです。このツールを使用することで、Excelの関数を介して最新の LLM (Large Language Models) を活用し、自動化されたエージェントを実行できます。ユーザーは Excel のセルに特定のプロンプトを記入するだけで、LLM を活用した複雑なクエリやデータ処理タスクを簡単に実行することが可能になります。 -たとえば、`=RunAgent("企業情報のリサーチャーとして振舞ってください。" & A1 & "の所在地を調べてください。")` という関数を使用すると、セルA1に入力された企業名の所在地を自動で調査し、結果をExcel上で直接表示します。これにより、手動でのデータ検索と入力の手間が省け、効率的に作業を進めることが可能です。 +たとえば、`=RunAgent("企業情報のリサーチャーとして振舞ってください。" & A1 & "の所在地を調べてください。")` という関数を使用すると、セル A1 に入力された企業名の所在地を自動で調査し、結果を Excel 上で直接表示します。これにより、手動でのデータ検索と入力の手間が省け、効率的に作業を進めることが可能です。 ### 特徴と利点 -ExcelAgentTemplateは次のような特徴を持っています: +ExcelAgentTemplate は次のような特徴を持っています: -- **直感的な操作**: Excelの関数として直接LLMを呼び出すため、特別なプログラミング知識は不要です。 +- **直感的な操作**: Excel の関数として直接 LLM を呼び出すため、特別なプログラミング知識は不要です。 - **高度な自動化**: 複雑なデータ収集や処理を自動化し、ワークフローを大幅に効率化します。 -- **カスタマイズ可能**: Pythonスクリプトを用いて、特定のニーズに合わせたエージェントの挙動をカスタマイズ可能です。 +- **カスタマイズ可能**: Python スクリプトを用いて、特定のニーズに合わせたエージェントの挙動をカスタマイズ可能です。 - **リアルタイム処理**: 非同期処理により、大量のデータも迅速に処理し、結果をリアルタイムで反映します。 ### 適用例 @@ -24,7 +24,7 @@ ExcelAgentTemplateは次のような特徴を持っています: ### 利用シナリオ -ExcelAgentTemplateは特に以下のような用途に適しています: +ExcelAgentTemplate はとくに以下のような用途に適しています: - **チェック リストの確認の自動化**: 多数のチェック リストに基づいて入力のチェックや修正を行う場合に適しています。 - **データ収集・分析**: 大量のデータから必要な情報を抽出し、分析する作業を自動化します。 @@ -58,24 +58,24 @@ ExcelAgentTemplateは特に以下のような用途に適しています: 2. `RunAgentClient/bin/Debug/RunAgentClient-AddIn64.xll` をダブルクリックします。 3. "使用できるデジタル署名がありません" という通知画面が表示されます。"このアドインをこのセッションに限り有効にする(E)" をクリックします。このセッションでのみ `RunAgent` 関数が使用できます。 4. そのセッションで空白のブックを新規作成してみましょう。 -5. 任意のセルに、例えば `=RunAgent("株式会社 ??? の従業員数を調べてください。")` と入力し、Enter キーを押下します。??? は適当に置き換えてください。 +5. 任意のセルに、たとえば `=RunAgent("株式会社 ??? の従業員数を調べてください。")` と入力し、Enter キーを押下します。??? は適当に置き換えてください。 6. `#N/A`と表示されます。Python の画面上では、処理中のログが表示されます。処理が完了すると、セルの内容が実際の出力に置き換わります。 ## 制限事項 -- OpenAI API の使用量に注意して使用して下さい。 +- OpenAI API の使用量に注意して使用してください。 - 本ツールは GPU を使用しません。 - ## よくある質問 Q. ExcelAgentTemplate はどのようなタスクに適していますか? -A. ExcelAgentTemplate は、データの収集、分析、レポート作成など、様々な業務タスクの自動化に適しています。特に、非定型的な作業や、外部データとの連携が必要な場合に威力を発揮します。 +A. ExcelAgentTemplate は、データの収集、分析、レポート作成など、さまざまな業務タスクの自動化に適しています。とくに、非定型的な作業や、外部データとの連携が必要な場合に威力を発揮します。 Q. 商用利用は可能ですか? A. はい、商用利用も可能です。MITライセンスの下で提供されているため、自由に利用・修正・配布ができます。 Q. エージェントを追加するにはどうしたらいいですか? -A. 以下を参考にして下さい。 +A. 以下を参考にしてください。 - エージェントを実装した API のエンド ポイントを公開します。この際、同一のメッセージが入力された場合のキャッシュ機構を使用すると良いです。 - 参考 https://python.langchain.com/docs/modules/model_io/llms/llm_caching/ - Excel のアドインは Excel-DNA を使用して作成します。LLM の出力には時間がかかるので、サンプル コードを参考に非同期な処理を行うようにしてください。 @@ -95,10 +95,10 @@ A. 以下を参考にして下さい。 ExcelAgentTemplateプロジェクトでは、以下の機能追加を予定しています。 -- [ ] Local LLM のサポート +- [ ] Local LLM のサポート - [ ] ドキュメントの充実化 -ご要望やアイデアがありましたら、Issue にてお知らせください。 +ご要望やアイデアがありましたら、Issue にてお知らせください。 ## ライセンス From 6012f13ddadd5ea4d0df650f5735b911f1a84aaf Mon Sep 17 00:00:00 2001 From: Akimitsu Inoue Date: Thu, 6 Jun 2024 17:00:05 +0900 Subject: [PATCH 02/19] chore: Add GitHub Actions workflow for building Excel add-in --- .github/workflows/build-excel-addin.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build-excel-addin.yml b/.github/workflows/build-excel-addin.yml index c7c0545..9b3de13 100644 --- a/.github/workflows/build-excel-addin.yml +++ b/.github/workflows/build-excel-addin.yml @@ -16,3 +16,9 @@ jobs: - run: | msbuild -version + + - name: Upload artifacts + uses: actions/upload-artifact@v1 + with: + name: excel-addin + path: 'Excel Add-in/bin/Release' From 5b0d4d808e428e40c15a5ec4ebd1f0c13550dd1d Mon Sep 17 00:00:00 2001 From: Akimitsu Inoue Date: Thu, 6 Jun 2024 17:02:27 +0900 Subject: [PATCH 03/19] chore: Remove unnecessary code for uploading artifacts --- .github/workflows/build-excel-addin.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build-excel-addin.yml b/.github/workflows/build-excel-addin.yml index 9b3de13..9504ede 100644 --- a/.github/workflows/build-excel-addin.yml +++ b/.github/workflows/build-excel-addin.yml @@ -19,6 +19,3 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v1 - with: - name: excel-addin - path: 'Excel Add-in/bin/Release' From 2cd3a61449321c57c9c52247e617ae9947b9c7d1 Mon Sep 17 00:00:00 2001 From: Akimitsu Inoue Date: Mon, 15 Jul 2024 13:09:45 +0000 Subject: [PATCH 04/19] Add auto-release --- .github/workflows/build-excel-addin.yml | 28 ++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-excel-addin.yml b/.github/workflows/build-excel-addin.yml index 9504ede..c4601c0 100644 --- a/.github/workflows/build-excel-addin.yml +++ b/.github/workflows/build-excel-addin.yml @@ -15,7 +15,29 @@ jobs: uses: microsoft/setup-msbuild@v1.0.2 - run: | - msbuild -version + msbuild -version /p:Configuration=Release - - name: Upload artifacts - uses: actions/upload-artifact@v1 + - name: Archive build artifacts + run: | + Compress-Archive -Path bin/Release/* -DestinationPath Release.zip + + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: build-artifacts.zip + asset_name: build-artifacts.zip + asset_content_type: application/zip From 048276ba9f9272e6cc6f095f2dfc489136153523 Mon Sep 17 00:00:00 2001 From: Akimitsu Inoue Date: Mon, 15 Jul 2024 13:36:56 +0000 Subject: [PATCH 05/19] Fix github actions --- .github/workflows/build-excel-addin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-excel-addin.yml b/.github/workflows/build-excel-addin.yml index c4601c0..a539ab9 100644 --- a/.github/workflows/build-excel-addin.yml +++ b/.github/workflows/build-excel-addin.yml @@ -19,7 +19,7 @@ jobs: - name: Archive build artifacts run: | - Compress-Archive -Path bin/Release/* -DestinationPath Release.zip + Compress-Archive -Path RunAgentClient/bin/Release/* -DestinationPath build-artifacts.zip - name: Create GitHub Release id: create_release From a2eedf43a376c4a11f57ce5ee317d9ea58ccf40f Mon Sep 17 00:00:00 2001 From: Akimitsu Inoue Date: Mon, 15 Jul 2024 13:38:30 +0000 Subject: [PATCH 06/19] Fix Github Actions --- .github/workflows/build-excel-addin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-excel-addin.yml b/.github/workflows/build-excel-addin.yml index a539ab9..731f683 100644 --- a/.github/workflows/build-excel-addin.yml +++ b/.github/workflows/build-excel-addin.yml @@ -19,7 +19,7 @@ jobs: - name: Archive build artifacts run: | - Compress-Archive -Path RunAgentClient/bin/Release/* -DestinationPath build-artifacts.zip + Compress-Archive -Path RunAgentClient/bin/Release -DestinationPath build-artifacts.zip - name: Create GitHub Release id: create_release From eac315590ca08b71e721a7dc84e9b0884d821c66 Mon Sep 17 00:00:00 2001 From: Akimitsu Inoue Date: Mon, 15 Jul 2024 13:43:33 +0000 Subject: [PATCH 07/19] Fix github actions --- .github/workflows/build-excel-addin.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build-excel-addin.yml b/.github/workflows/build-excel-addin.yml index 731f683..69078aa 100644 --- a/.github/workflows/build-excel-addin.yml +++ b/.github/workflows/build-excel-addin.yml @@ -17,6 +17,18 @@ jobs: - run: | msbuild -version /p:Configuration=Release + - name: List build artifacts + run: | + dir RunAgentClient + + - name: List build artifacts + run: | + dir RunAgentClientbin\bin + + - name: List build artifacts + run: | + dir RunAgentClient\bin\Release + - name: Archive build artifacts run: | Compress-Archive -Path RunAgentClient/bin/Release -DestinationPath build-artifacts.zip From 3edbd87bd6eb67865f2bbcb9fec3606c9f23692c Mon Sep 17 00:00:00 2001 From: Akimitsu Inoue Date: Mon, 15 Jul 2024 13:44:36 +0000 Subject: [PATCH 08/19] Fix listing --- .github/workflows/build-excel-addin.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-excel-addin.yml b/.github/workflows/build-excel-addin.yml index 69078aa..f08042d 100644 --- a/.github/workflows/build-excel-addin.yml +++ b/.github/workflows/build-excel-addin.yml @@ -17,6 +17,10 @@ jobs: - run: | msbuild -version /p:Configuration=Release + - name: List build artifacts + run: | + dir + - name: List build artifacts run: | dir RunAgentClient From 15284991197af655a1bf57f42efe349aa5a5e66c Mon Sep 17 00:00:00 2001 From: Akimitsu Inoue Date: Mon, 15 Jul 2024 13:46:25 +0000 Subject: [PATCH 09/19] Fix used function --- .github/workflows/build-excel-addin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-excel-addin.yml b/.github/workflows/build-excel-addin.yml index f08042d..d215623 100644 --- a/.github/workflows/build-excel-addin.yml +++ b/.github/workflows/build-excel-addin.yml @@ -27,7 +27,7 @@ jobs: - name: List build artifacts run: | - dir RunAgentClientbin\bin + dir RunAgentClientbin\RunAgentClientbin - name: List build artifacts run: | From 8451c39c78347a02bb8a693d9019324e5bf37ebf Mon Sep 17 00:00:00 2001 From: Akimitsu Inoue Date: Mon, 15 Jul 2024 13:48:41 +0000 Subject: [PATCH 10/19] Fix typos --- .github/workflows/build-excel-addin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-excel-addin.yml b/.github/workflows/build-excel-addin.yml index d215623..6b0c041 100644 --- a/.github/workflows/build-excel-addin.yml +++ b/.github/workflows/build-excel-addin.yml @@ -27,7 +27,7 @@ jobs: - name: List build artifacts run: | - dir RunAgentClientbin\RunAgentClientbin + dir RunAgentClient\RunAgentClient - name: List build artifacts run: | From 8f57dcdfd3cf962828398e38be0b6925bc86ac83 Mon Sep 17 00:00:00 2001 From: Akimitsu Inoue Date: Mon, 15 Jul 2024 13:51:32 +0000 Subject: [PATCH 11/19] Fix RunAgentClient symbols. --- .github/workflows/build-excel-addin.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-excel-addin.yml b/.github/workflows/build-excel-addin.yml index 6b0c041..1f5f232 100644 --- a/.github/workflows/build-excel-addin.yml +++ b/.github/workflows/build-excel-addin.yml @@ -31,11 +31,11 @@ jobs: - name: List build artifacts run: | - dir RunAgentClient\bin\Release + dir RunAgentClient\RunAgentClient\bin\Release - name: Archive build artifacts run: | - Compress-Archive -Path RunAgentClient/bin/Release -DestinationPath build-artifacts.zip + Compress-Archive -Path RunAgentClient/RunAgentClient/bin/Release -DestinationPath build-artifacts.zip - name: Create GitHub Release id: create_release From 61e6e5045fbeac6565c823673437f834cd0c571c Mon Sep 17 00:00:00 2001 From: Akimitsu Inoue Date: Tue, 16 Jul 2024 07:17:17 +0000 Subject: [PATCH 12/19] Add debug message --- .github/workflows/build-excel-addin.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-excel-addin.yml b/.github/workflows/build-excel-addin.yml index 1f5f232..1a54235 100644 --- a/.github/workflows/build-excel-addin.yml +++ b/.github/workflows/build-excel-addin.yml @@ -17,6 +17,10 @@ jobs: - run: | msbuild -version /p:Configuration=Release + - name: List build directory + run: | + Get-ChildItem -Recurse . | Format-List + - name: List build artifacts run: | dir From b777d33037805686f883053a129f03a5a24fe585 Mon Sep 17 00:00:00 2001 From: Akimitsu Inoue Date: Tue, 16 Jul 2024 07:19:38 +0000 Subject: [PATCH 13/19] Fix debug message --- .github/workflows/build-excel-addin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-excel-addin.yml b/.github/workflows/build-excel-addin.yml index 1a54235..876c93b 100644 --- a/.github/workflows/build-excel-addin.yml +++ b/.github/workflows/build-excel-addin.yml @@ -19,7 +19,7 @@ jobs: - name: List build directory run: | - Get-ChildItem -Recurse . | Format-List + Get-ChildItem -Recurse .. | Format-List - name: List build artifacts run: | From db2a463c80a7f0668237caaa8f5051e9d8c2740a Mon Sep 17 00:00:00 2001 From: Akimitsu Inoue Date: Tue, 16 Jul 2024 08:00:35 +0000 Subject: [PATCH 14/19] Change github actions --- .github/workflows/build-excel-addin.yml | 151 ++++++++++++++++++------ 1 file changed, 113 insertions(+), 38 deletions(-) diff --git a/.github/workflows/build-excel-addin.yml b/.github/workflows/build-excel-addin.yml index 876c93b..6b2279b 100644 --- a/.github/workflows/build-excel-addin.yml +++ b/.github/workflows/build-excel-addin.yml @@ -4,60 +4,135 @@ on: pull_request: types: [synchronize, opened] + jobs: build: - runs-on: windows-2019 + strategy: + matrix: + configuration: [Release] # [Debug, Release] + runs-on: windows-latest + timeout-minutes: 15 + steps: + # Dump for debug workflow + - name: Dump Github Context + env: + GitHub_Context: ${{ toJson(github) }} + run: echo "${GitHub_Context}" + + # Checks-out repository under $GITHUB_WORKSPACE: https://github.com/actions/checkout - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + # Install the .NET workload: https://github.com/actions/setup-dotnet + - name: Install .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.0.2 + # Add MsBuild to the PATH: https://github.com/microsoft/setup-msbuild + - name: Setup MSBuild.exe + uses: microsoft/setup-msbuild@v1.3.1 - - run: | - msbuild -version /p:Configuration=Release + # Restore before build and test + - name: Restore + run: dotnet restore ${{ env.Solution_Path }} - - name: List build directory - run: | - Get-ChildItem -Recurse .. | Format-List - - - name: List build artifacts - run: | - dir + - name: Build with dotnet + run: dotnet build ${{ env.App_Project_Path }} --no-restore + env: + Configuration: ${{ matrix.configuration }} - - name: List build artifacts - run: | - dir RunAgentClient + # Execute all unit tests in the solution + - name: Execute unit tests + run: dotnet test --no-restore + + create-release: + runs-on: windows-latest + timeout-minutes: 15 + needs: [build] + if: "contains( github.ref , 'tags/v')" - - name: List build artifacts + steps: + - name: Get version + shell: bash run: | - dir RunAgentClient\RunAgentClient + echo "ver=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV - - name: List build artifacts + - name: Set env + shell: bash run: | - dir RunAgentClient\RunAgentClient\bin\Release + echo "version=${{ env.ver }}" >> $GITHUB_ENV # exeに反映されます + # echo "fileversion=${{ env.ver }}" >> $GITHUB_ENV # 未設定だとVersionに連動します + echo "app_x64_framework_name=${{ env.App_Name }}_win-x64_framework-dependent_ver${{ env.ver }}" >> $GITHUB_ENV + echo "app_x64_self_name=${{ env.App_Name }}_win-x64_self-contained_ver${{ env.ver }}" >> $GITHUB_ENV + + # Checks-out repository under $GITHUB_WORKSPACE: https://github.com/actions/checkout + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + # don't output pdb -> /p:DebugType=None /p:DebugSymbols=false + - name: dotnet publish x64 Framework-dependent + run: > + dotnet publish ${{ env.App_Project_Path }} + -c Release + -r win-x64 + --self-contained false -p:UseAppHost=true + -p:PublishSingleFile=true + -p:PublishReadyToRun=false + -p:PublishTrimmed=false + -p:IncludeNativeLibrariesForSelfExtract=true + -o outputs\${{ env.app_x64_framework_name }} + + # don't output pdb -> /p:DebugType=None /p:DebugSymbols=false + - name: dotnet publish x64 Self-contained + run: > + dotnet publish ${{ env.App_Project_Path }} + -c Release + -r win-x64 + --self-contained true + -p:PublishSingleFile=true + -p:PublishReadyToRun=false + -p:PublishTrimmed=false + -p:IncludeNativeLibrariesForSelfExtract=true + -o outputs\${{ env.app_x64_self_name }} - - name: Archive build artifacts + # Upload Actions Artifacts: https://github.com/actions/upload-artifact + - name: Archive publish files + uses: actions/upload-artifact@v4 + with: + name: ${{ env.App_Name }} + path: outputs + + # Create zip + - name: Create zip archive + shell: pwsh run: | - Compress-Archive -Path RunAgentClient/RunAgentClient/bin/Release -DestinationPath build-artifacts.zip - - - name: Create GitHub Release + Compress-Archive -Path outputs\${{ env.app_x64_framework_name }} -DestinationPath ${{ env.app_x64_framework_name }}.zip + Compress-Archive -Path outputs\${{ env.app_x64_self_name }} -DestinationPath ${{ env.app_x64_self_name }}.zip + + # Create release page: https://github.com/ncipollo/release-action + - name: Create release id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: ncipollo/release-action@v1 with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - draft: false + token: ${{ secrets.GITHUB_TOKEN }} + tag: v${{ env.ver }} + name: Ver ${{ env.ver }} + body: | + - Change design + - Bug fix + draft: true prerelease: false + artifacts: "${{ env.app_x64_framework_name }}.zip, ${{ env.app_x64_self_name }}.zip" - - name: Upload Release Asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Remove artifacts to save space: https://github.com/c-hive/gha-remove-artifacts + - name: Remove old artifacts + uses: c-hive/gha-remove-artifacts@v1 with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: build-artifacts.zip - asset_name: build-artifacts.zip - asset_content_type: application/zip + age: '1 weeks' + skip-recent: 2 \ No newline at end of file From 25eaec660044ffddbbcafb985c6d98d041c85686 Mon Sep 17 00:00:00 2001 From: Akimitsu Inoue Date: Tue, 16 Jul 2024 08:04:47 +0000 Subject: [PATCH 15/19] Add env --- .github/workflows/build-excel-addin.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-excel-addin.yml b/.github/workflows/build-excel-addin.yml index 6b2279b..361ccbe 100644 --- a/.github/workflows/build-excel-addin.yml +++ b/.github/workflows/build-excel-addin.yml @@ -4,6 +4,10 @@ on: pull_request: types: [synchronize, opened] +env: + App_Name: RunAgentClient + Solution_Path: RunAgentClient/RunAgentClient.sln + App_Project_Path: RunAgentClient/RunAgentClient/RunAgentClient.csproj jobs: build: From ed2ad97e8cff4149bb6d9a472004aba0368636b2 Mon Sep 17 00:00:00 2001 From: Akimitsu Inoue Date: Tue, 16 Jul 2024 08:08:29 +0000 Subject: [PATCH 16/19] Add restore --- .github/workflows/build-excel-addin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-excel-addin.yml b/.github/workflows/build-excel-addin.yml index 361ccbe..d35c054 100644 --- a/.github/workflows/build-excel-addin.yml +++ b/.github/workflows/build-excel-addin.yml @@ -45,7 +45,7 @@ jobs: run: dotnet restore ${{ env.Solution_Path }} - name: Build with dotnet - run: dotnet build ${{ env.App_Project_Path }} --no-restore + run: dotnet build ${{ env.App_Project_Path }} env: Configuration: ${{ matrix.configuration }} From 51f1c6e0fb1fab0c040e01b03360ec2784a376d6 Mon Sep 17 00:00:00 2001 From: Akimitsu Inoue Date: Tue, 16 Jul 2024 08:10:49 +0000 Subject: [PATCH 17/19] Change restore to another step --- .github/workflows/build-excel-addin.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-excel-addin.yml b/.github/workflows/build-excel-addin.yml index d35c054..e6003e5 100644 --- a/.github/workflows/build-excel-addin.yml +++ b/.github/workflows/build-excel-addin.yml @@ -44,8 +44,11 @@ jobs: - name: Restore run: dotnet restore ${{ env.Solution_Path }} + - name: Restore + run: dotnet restore ${{ env.App_Project_Path }} + - name: Build with dotnet - run: dotnet build ${{ env.App_Project_Path }} + run: dotnet build ${{ env.App_Project_Path }} --no-restore env: Configuration: ${{ matrix.configuration }} From 51d665c571f6d41c833e8498f20683ad2c7b8869 Mon Sep 17 00:00:00 2001 From: Akimitsu Inoue Date: Tue, 16 Jul 2024 08:16:07 +0000 Subject: [PATCH 18/19] Use msbuild --- .github/workflows/build-excel-addin.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-excel-addin.yml b/.github/workflows/build-excel-addin.yml index e6003e5..e6d0f6e 100644 --- a/.github/workflows/build-excel-addin.yml +++ b/.github/workflows/build-excel-addin.yml @@ -47,10 +47,15 @@ jobs: - name: Restore run: dotnet restore ${{ env.App_Project_Path }} - - name: Build with dotnet - run: dotnet build ${{ env.App_Project_Path }} --no-restore + # - name: Build with dotnet + # run: dotnet build ${{ env.App_Project_Path }} --no-restore + # env: + # Configuration: ${{ matrix.configuration }} + + - name: Build + run: msbuild ${{ env.App_Project_Path }} /t:Build /p:Configuration=Release env: - Configuration: ${{ matrix.configuration }} + DOTNET_ROOT: C:\Program Files\dotnet # Execute all unit tests in the solution - name: Execute unit tests From 4e00f46fbdcd9c946e43d6406601f8b82046cfef Mon Sep 17 00:00:00 2001 From: Akimitsu Inoue Date: Tue, 16 Jul 2024 08:21:41 +0000 Subject: [PATCH 19/19] Remove release --- .github/workflows/build-excel-addin.yml | 144 +----------------------- 1 file changed, 6 insertions(+), 138 deletions(-) diff --git a/.github/workflows/build-excel-addin.yml b/.github/workflows/build-excel-addin.yml index e6d0f6e..413641f 100644 --- a/.github/workflows/build-excel-addin.yml +++ b/.github/workflows/build-excel-addin.yml @@ -4,147 +4,15 @@ on: pull_request: types: [synchronize, opened] -env: - App_Name: RunAgentClient - Solution_Path: RunAgentClient/RunAgentClient.sln - App_Project_Path: RunAgentClient/RunAgentClient/RunAgentClient.csproj - jobs: build: - strategy: - matrix: - configuration: [Release] # [Debug, Release] - runs-on: windows-latest - timeout-minutes: 15 - - steps: - # Dump for debug workflow - - name: Dump Github Context - env: - GitHub_Context: ${{ toJson(github) }} - run: echo "${GitHub_Context}" - - # Checks-out repository under $GITHUB_WORKSPACE: https://github.com/actions/checkout - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - # Install the .NET workload: https://github.com/actions/setup-dotnet - - name: Install .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 8.0.x - - # Add MsBuild to the PATH: https://github.com/microsoft/setup-msbuild - - name: Setup MSBuild.exe - uses: microsoft/setup-msbuild@v1.3.1 - - # Restore before build and test - - name: Restore - run: dotnet restore ${{ env.Solution_Path }} - - - name: Restore - run: dotnet restore ${{ env.App_Project_Path }} - - # - name: Build with dotnet - # run: dotnet build ${{ env.App_Project_Path }} --no-restore - # env: - # Configuration: ${{ matrix.configuration }} - - - name: Build - run: msbuild ${{ env.App_Project_Path }} /t:Build /p:Configuration=Release - env: - DOTNET_ROOT: C:\Program Files\dotnet - - # Execute all unit tests in the solution - - name: Execute unit tests - run: dotnet test --no-restore - - create-release: - runs-on: windows-latest - timeout-minutes: 15 - needs: [build] - if: "contains( github.ref , 'tags/v')" - + runs-on: windows-2019 steps: - - name: Get version - shell: bash - run: | - echo "ver=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV - - - name: Set env - shell: bash - run: | - echo "version=${{ env.ver }}" >> $GITHUB_ENV # exeに反映されます - # echo "fileversion=${{ env.ver }}" >> $GITHUB_ENV # 未設定だとVersionに連動します - echo "app_x64_framework_name=${{ env.App_Name }}_win-x64_framework-dependent_ver${{ env.ver }}" >> $GITHUB_ENV - echo "app_x64_self_name=${{ env.App_Name }}_win-x64_self-contained_ver${{ env.ver }}" >> $GITHUB_ENV - - # Checks-out repository under $GITHUB_WORKSPACE: https://github.com/actions/checkout - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - # don't output pdb -> /p:DebugType=None /p:DebugSymbols=false - - name: dotnet publish x64 Framework-dependent - run: > - dotnet publish ${{ env.App_Project_Path }} - -c Release - -r win-x64 - --self-contained false -p:UseAppHost=true - -p:PublishSingleFile=true - -p:PublishReadyToRun=false - -p:PublishTrimmed=false - -p:IncludeNativeLibrariesForSelfExtract=true - -o outputs\${{ env.app_x64_framework_name }} - - # don't output pdb -> /p:DebugType=None /p:DebugSymbols=false - - name: dotnet publish x64 Self-contained - run: > - dotnet publish ${{ env.App_Project_Path }} - -c Release - -r win-x64 - --self-contained true - -p:PublishSingleFile=true - -p:PublishReadyToRun=false - -p:PublishTrimmed=false - -p:IncludeNativeLibrariesForSelfExtract=true - -o outputs\${{ env.app_x64_self_name }} - - # Upload Actions Artifacts: https://github.com/actions/upload-artifact - - name: Archive publish files - uses: actions/upload-artifact@v4 - with: - name: ${{ env.App_Name }} - path: outputs - - # Create zip - - name: Create zip archive - shell: pwsh - run: | - Compress-Archive -Path outputs\${{ env.app_x64_framework_name }} -DestinationPath ${{ env.app_x64_framework_name }}.zip - Compress-Archive -Path outputs\${{ env.app_x64_self_name }} -DestinationPath ${{ env.app_x64_self_name }}.zip + uses: actions/checkout@v2 - # Create release page: https://github.com/ncipollo/release-action - - name: Create release - id: create_release - uses: ncipollo/release-action@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - tag: v${{ env.ver }} - name: Ver ${{ env.ver }} - body: | - - Change design - - Bug fix - draft: true - prerelease: false - artifacts: "${{ env.app_x64_framework_name }}.zip, ${{ env.app_x64_self_name }}.zip" + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.0.2 - # Remove artifacts to save space: https://github.com/c-hive/gha-remove-artifacts - - name: Remove old artifacts - uses: c-hive/gha-remove-artifacts@v1 - with: - age: '1 weeks' - skip-recent: 2 \ No newline at end of file + - run: | + msbuild -version /p:Configuration=Release