Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: MSBuild

on:
workflow_dispatch:
pull_request:
push:
branches:
Expand All @@ -18,10 +19,10 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6.0.1

- name: Setup .NET
uses: actions/setup-dotnet@v4.0.0
uses: actions/setup-dotnet@v5.0.1

- name: Restore nuget packages
run: dotnet restore BveExCsTemplate.sln --locked-mode
Expand All @@ -33,11 +34,11 @@ jobs:
run: |
ls -alR
mkdir plugins/
find . -type f -path '*/out/publish/*.dll' | xargs mv -t ./plugins/
find . -type f -path '*/out/publish/*.dll' -exec cp {} ./plugins/ \;
shell: bash

- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v6.0.0
with:
name: plugins
path: ./plugins/
65 changes: 42 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,54 @@ jobs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6.0.1
- name: Setup .NET
uses: actions/setup-dotnet@v4.0.0
uses: actions/setup-dotnet@v5.0.1
- name: Restore nuget packages
run: dotnet restore BveExCsTemplate.sln --locked-mode
- name: Build sln
run: dotnet publish .\BveExCsTemplate.sln --configuration Release --no-restore /p:platform="Any CPU" /p:OutputPath="./out/"
- name: Collect artifact
run: |
mkdir plugins/
find . -type f -path '*/out/publish/*.dll' | xargs mv -t ./plugins/
# 各プロジェクトディレクトリからプロジェクト名と同じDLLのみを収集
find . -maxdepth 2 -name "*.csproj" -type f | while read csproj; do
proj_dir=$(dirname "$csproj")
proj_name=$(basename "$csproj" .csproj)
dll_path="${proj_dir}/out/publish/${proj_name}.dll"
if [ -f "$dll_path" ]; then
echo "Collecting: $dll_path"
cp "$dll_path" ./plugins/
else
echo "Warning: $dll_path not found"
fi
done
# 収集結果を表示
echo "Collected DLLs:"
ls -lh ./plugins/
shell: bash
- name: Check assembly version
id: version
run: |
Get-ChildItem plugins/ -Recurse -Filter "*.dll" -File | foreach {
Write-Output $_.FileName
$_.FileName
"name=$_" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
$ver=(Get-Item $_.FullName).VersionInfo.FileVersion
$ver
"version=v$ver" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
$files = Get-ChildItem plugins/ -Filter "*.dll" -File
if ($files.Count -eq 0) {
Write-Error "No DLL files found in plugins/"
exit 1
}

Write-Output "=== DLL Version Check ==="
$firstVersion = $null
foreach ($file in $files) {
$ver = (Get-Item $file.FullName).VersionInfo.FileVersion
Write-Output "$($file.Name): v$ver"
if ($null -eq $firstVersion) {
$firstVersion = $ver
"version=v$ver" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
}
}
shell: pwsh
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v6.0.0
with:
name: plugins
path: ./plugins/
Expand All @@ -55,30 +77,27 @@ jobs:
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6.0.1
- name: Download artifact
uses: actions/download-artifact@v6.0.0
with:
name: plugins
path: ./plugins/
- name: Create tag
uses: rickstaa/action-create-tag@v1
uses: rickstaa/action-create-tag@v1.7.2
id: "tag_create"
with:
tag: "${{needs.build.outputs.version}}"
tag_exists_error: true
message: "Created tag ${{needs.build.outputs.version}}"
- name: Get repository name
run: |
echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/}" >> $GITHUB_ENV
echo "FILE_NAME=${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/}_${{needs.build.outputs.version}}" >> $GITHUB_ENV
- name: Compress DLLs
run: |
cd plugins/
zip ${{env.FILE_NAME}}.zip -r *
- name: Create Release Draft and Upload Release Asset
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2.5.0
with:
tag_name: ${{needs.build.outputs.version}}
name: Release ${{needs.build.outputs.version}}
body: TODO New Release.
draft: true
prerelease: false
files: |
./plugins/${{env.FILE_NAME}}.zip
./plugins/*.dll
LICENSE