-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
146 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
- actions | ||
tags: | ||
- '*' | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up .NET Core | ||
uses: actions/setup-dotnet@v1.7.2 | ||
with: | ||
dotnet-version: 3.1.x | ||
|
||
- name: Prepare Environment | ||
run: .\prepare_environment.ps1 "Source\SmallMenu\manifest.json" | ||
|
||
- name: Fetch Beat Saber Bindings | ||
run: git clone https://nicoco007:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/nicoco007/BeatSaberBindings "BeatSaberBindings\Beat Saber_Data\Managed" | ||
|
||
- name: Restore NuGet Packages | ||
run: dotnet restore Source\SmallMenu\SmallMenu.csproj | ||
|
||
- name: Build Debug | ||
run: dotnet build --no-restore Source\SmallMenu\SmallMenu.csproj -c Debug -p:BeatSaberDir=..\..\BeatSaberBindings | ||
|
||
- name: Upload Debug | ||
uses: actions/upload-artifact@v2.2.0 | ||
with: | ||
name: BeatSaberSmallMenus-${{ env.ZIP_VERSION }}-DEBUG | ||
path: Source\SmallMenu\bin\Debug\netstandard2.0\publish | ||
|
||
- name: Build Release | ||
run: dotnet build --no-restore Source\SmallMenu\SmallMenu.csproj -c Release -p:BeatSaberDir=..\..\BeatSaberBindings | ||
|
||
- name: Upload Release | ||
uses: actions/upload-artifact@v2.2.0 | ||
with: | ||
name: BeatSaberSmallMenus-${{ env.ZIP_VERSION }}-RELEASE | ||
path: Source\SmallMenu\bin\Release\netstandard2.0\publish |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<Project> | ||
|
||
<Target Name="CheckBSMTInstalled" AfterTargets="BeforeBuild" Condition="'$(BSMTTaskAssembly)' == ''"> | ||
<Error Text="The BeatSaberModdingTools.Tasks NuGet package doesn't seem to be installed. Please restore NuGet packages before building the project." /> | ||
</Target> | ||
|
||
<Target Name="SetAssemblyVersion" AfterTargets="CheckBSMTInstalled"> | ||
<GetManifestInfo> | ||
<Output TaskParameter="BasePluginVersion" PropertyName="BasePluginVersion" /> | ||
</GetManifestInfo> | ||
|
||
<PropertyGroup> | ||
<Version>$(BasePluginVersion)</Version> | ||
</PropertyGroup> | ||
</Target> | ||
|
||
<Target Name="Organize" AfterTargets="AfterBuild"> | ||
<!-- remove deps.json file since it's not used --> | ||
<Delete Files="$(TargetDir)$(TargetName).deps.json" /> | ||
|
||
<!-- make sure we have a clean slate --> | ||
<RemoveDir Directories="$(PublishDir)" /> | ||
|
||
<!-- create Plugins folder and move plugin DLL/PDB inside --> | ||
<MakeDir Directories="$(PublishDir)Plugins" /> | ||
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(PublishDir)Plugins" /> | ||
<Copy SourceFiles="$(TargetDir)$(TargetName).pdb" DestinationFolder="$(PublishDir)Plugins" Condition="$(DebugType) == 'portable'" /> | ||
</Target> | ||
|
||
<Target Name="CopyToBeatSaberFolder" AfterTargets="AfterBuild" Condition="$(BeatSaberDir) != ''"> | ||
<ItemGroup> | ||
<CopyToBeatSaberFolder Include="$(PublishDir)**\*.*" /> | ||
</ItemGroup> | ||
|
||
<Copy SourceFiles="@(CopyToBeatSaberFolder)" DestinationFiles="@(CopyToBeatSaberFolder->'$(BeatSaberDir)\%(RecursiveDir)%(Filename)%(Extension)')" /> | ||
</Target> | ||
|
||
</Project> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
$ErrorActionPreference = "Stop" | ||
|
||
$check = [char]0x2713 | ||
$cross = [char]0x2717 | ||
|
||
if ($args.Length -ne 1) { | ||
Write-Host "Invalid number of arguments" -ForegroundColor Red | ||
exit(-1) | ||
} | ||
|
||
if ($args[0] -eq "" -or !(Test-Path $args[0])) { | ||
Write-Host "File '$($args[0])' does not exist" -ForegroundColor Red | ||
exit(-1) | ||
} | ||
|
||
$manifest_content = Get-Content $args[0] | ConvertFrom-Json | ||
|
||
$manifest_version_str = $manifest_content.version | ||
$semver = [regex]::Match($manifest_version_str, '^(?<prerelease>(?<version>(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*))(?:-(?:(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?)(?:\+(?:[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$') | ||
|
||
$numeric_version = $semver.groups['version'].value | ||
$version_with_prerelease = $semver.groups['prerelease'].value | ||
|
||
$git_hash = (git log -n 1 --pretty=%h).Trim() | ||
$git_tag = git tag -l --points-at HEAD | ||
|
||
if ($git_tag -ne "" -and $git_tag.Length -gt 0) { | ||
if ($git_tag -ne "v$version_with_prerelease") { | ||
Write-Host "$cross Git tag '$git_tag' does not match manifest version '$version_with_prerelease'" -ForegroundColor Red | ||
exit(-1) | ||
} | ||
|
||
Write-Host "$check Using Git tag '$git_tag'" -ForegroundColor Green | ||
$manifest_content.version = $version_with_prerelease | ||
$zip_version = "v$version_with_prerelease" | ||
} elseif ($git_hash -ne "" -and $git_hash.Length -gt 0) { | ||
Write-Host "$check Using Git hash '$git_hash'" -ForegroundColor Green | ||
$manifest_content.version = "$version_with_prerelease+git.$git_hash" | ||
$zip_version = $git_hash | ||
} else { | ||
Write-Host "$cross Could not find Git tag or hash" -ForegroundColor Red | ||
exit(-1) | ||
} | ||
|
||
Add-Content "$env:GITHUB_ENV" "ZIP_VERSION=$zip_version" | ||
|
||
$manifest_content | ConvertTo-Json | Set-Content $args[0] |