Skip to content

Commit

Permalink
Add release script; Inclide readme and license in releases
Browse files Browse the repository at this point in the history
  • Loading branch information
ManlyMarco committed Nov 27, 2023
1 parent e3b754d commit 4543547
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ConfigurationManager/ConfigurationManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>embedded</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\bin\BepInEx\plugins\</OutputPath>
<OutputPath>..\bin\BepInEx5\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>embedded</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\bin\BepInEx\plugins\</OutputPath>
<OutputPath>..\bin\BepInEx5\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DebugSymbols>true</DebugSymbols>
<DocumentationFile>..\bin\BepInEx\plugins\ConfigurationManager.xml</DocumentationFile>
<DocumentationFile>..\bin\BepInEx5\ConfigurationManager.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="BepInEx, Version=5.4.20.0, Culture=neutral, processorArchitecture=MSIL">
Expand Down
27 changes: 27 additions & 0 deletions release.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
if ($PSScriptRoot -match '.+?\\bin\\?') {
$dir = $PSScriptRoot + "\"
}
else {
$dir = $PSScriptRoot + "\bin\"
}


foreach($target in ("BepInEx5","IL2CPP"))
{
$copy = $dir + "copy\BepInEx\plugins\ConfigurationManager\"

Remove-Item -Force -Path ($copy) -Recurse -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path ($copy)

Copy-Item -Path ($dir + $target + "\*") -Destination ($copy) -Recurse -Force
Remove-Item -Force -Path ($copy + "\*.deps.json") -Recurse -ErrorAction SilentlyContinue

Copy-Item -Path ($dir + "\..\README.md") -Destination ($copy) -Recurse -Force
Copy-Item -Path ($dir + "\..\LICENSE") -Destination ($copy) -Recurse -Force
Copy-Item -Path ($dir + "\..\ConfigurationManagerAttributes.cs") -Destination ($copy) -Recurse -Force

$ver = (Get-ChildItem -Path ($dir + $target) -Filter ("*ConfigurationManager.dll") -Recurse -Force)[0].VersionInfo.FileVersion.ToString() -replace "([\d+\.]+?\d+)[\.0]*$", '${1}'
Compress-Archive -Path ($dir + "copy\BepInEx") -Force -CompressionLevel "Optimal" -DestinationPath ($dir + "BepInEx.ConfigurationManager." + $target +"_v" + $ver + ".zip")
}

Remove-Item -Force -Path ($dir + "copy") -Recurse -ErrorAction SilentlyContinue

0 comments on commit 4543547

Please sign in to comment.
  翻译: