mirror of
https://github.com/NuclearPowered/Reactor.git
synced 2026-10-19 15:51:54 +00:00
Update CI
This commit is contained in:
3 files changed
+16
-13
No files matched your search
@@ -3,7 +3,7 @@
|
|||||||
"isRoot": true,
|
"isRoot": true,
|
||||||
"tools": {
|
"tools": {
|
||||||
"cake.tool": {
|
"cake.tool": {
|
||||||
"version": "1.1.0",
|
"version": "2.2.0",
|
||||||
"commands": [
|
"commands": [
|
||||||
"dotnet-cake"
|
"dotnet-cake"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -46,7 +46,12 @@ jobs:
|
|||||||
path: Reactor.Debugger/bin/Release/net6.0/Reactor.Debugger.dll
|
path: Reactor.Debugger/bin/Release/net6.0/Reactor.Debugger.dll
|
||||||
|
|
||||||
- uses: softprops/action-gh-release@v1
|
- uses: softprops/action-gh-release@v1
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: github.ref_type == 'tag'
|
||||||
with:
|
with:
|
||||||
draft: true
|
draft: true
|
||||||
files: Reactor/bin/Release/net6.0/Reactor.dll
|
files: Reactor/bin/Release/net6.0/Reactor.dll
|
||||||
|
|
||||||
|
- name: Push nightly NuGet package
|
||||||
|
if: github.repository == 'NuclearPowered/Reactor' && github.ref == 'refs/heads/master'
|
||||||
|
run: |
|
||||||
|
dotnet nuget push Reactor/bin/Release/Reactor.*.nupkg --source https://nuget.reactor.gg/v3/index.json --api-key ${{ secrets.REACTOR_NUGET_KEY }}
|
||||||
+9
-11
@@ -1,33 +1,31 @@
|
|||||||
var target = Argument("target", "Build");
|
var target = Argument("target", "Build");
|
||||||
|
|
||||||
var buildId = EnvironmentVariable("GITHUB_RUN_NUMBER");
|
var workflow = BuildSystem.GitHubActions.Environment.Workflow;
|
||||||
|
var buildId = workflow.RunNumber;
|
||||||
var @ref = EnvironmentVariable("GITHUB_REF");
|
var tag = workflow.RefType == GitHubActionsRefType.Tag ? workflow.RefName : null;
|
||||||
const string prefix = "refs/tags/";
|
|
||||||
var tag = !string.IsNullOrEmpty(@ref) && @ref.StartsWith(prefix) ? @ref.Substring(prefix.Length) : null;
|
|
||||||
|
|
||||||
Task("Build")
|
Task("Build")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
var settings = new DotNetCoreBuildSettings
|
var settings = new DotNetBuildSettings
|
||||||
{
|
{
|
||||||
Configuration = "Release",
|
Configuration = "Release",
|
||||||
MSBuildSettings = new DotNetCoreMSBuildSettings()
|
MSBuildSettings = new DotNetMSBuildSettings()
|
||||||
};
|
};
|
||||||
|
|
||||||
if (tag != null)
|
if (tag != null)
|
||||||
{
|
{
|
||||||
settings.MSBuildSettings.Properties["Version"] = new[] { tag };
|
settings.MSBuildSettings.Version = tag;
|
||||||
}
|
}
|
||||||
else if (buildId != null)
|
else if (buildId != 0)
|
||||||
{
|
{
|
||||||
settings.VersionSuffix = "ci." + buildId;
|
settings.MSBuildSettings.VersionSuffix = "ci." + buildId;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var gamePlatform in new[] { "Steam", "Itch" })
|
foreach (var gamePlatform in new[] { "Steam", "Itch" })
|
||||||
{
|
{
|
||||||
settings.MSBuildSettings.Properties["GamePlatform"] = new[] { gamePlatform };
|
settings.MSBuildSettings.Properties["GamePlatform"] = new[] { gamePlatform };
|
||||||
DotNetCoreBuild(".", settings);
|
DotNetBuild(".", settings);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user