-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
14 changed files
with
1,191 additions
and
2 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
24 changes: 24 additions & 0 deletions
24
source/Reloaded.Mod.Template/Reloaded.Mod.Template.Nupkg.csproj
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,24 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<PackageType>Template</PackageType> | ||
<PackageVersion>1.0</PackageVersion> | ||
<PackageId>Reloaded.Mod.Templates</PackageId> | ||
<Title>Reloaded-II Mod Templates</Title> | ||
<Authors>Sewer56</Authors> | ||
<Description>Templates to use when creating a Reloaded Mod.</Description> | ||
<PackageTags>dotnet-new;templates;reloaded</PackageTags> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
|
||
<IncludeContentInPack>true</IncludeContentInPack> | ||
<IncludeBuildOutput>false</IncludeBuildOutput> | ||
<ContentTargetFolders>content</ContentTargetFolders> | ||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="templates\**\*" Exclude="templates\**\bin\**;templates\**\obj\**" /> | ||
<Compile Remove="**\*" /> | ||
</ItemGroup> | ||
|
||
</Project> |
144 changes: 144 additions & 0 deletions
144
source/Reloaded.Mod.Template/templates/configurable/.github/workflows/reloaded.yml
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,144 @@ | ||
# Script to build and publish a Reloaded Mod. | ||
# by Sewer56 | ||
|
||
# Produces: | ||
# - Build to Upload to GameBanana | ||
# - Build to Upload to GitHub | ||
# - Build to Upload to NuGet | ||
# - Changelog | ||
|
||
# When pushing a tag | ||
# - Upload to GitHub Releases | ||
# - Upload to Reloaded NuGet Repository (if GitHub Secret RELOADED_NUGET_KEY is specified) | ||
|
||
name: Build and Publish Reloaded Mod | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
tags: | ||
- '*' | ||
pull_request: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
|
||
env: | ||
PUBLISH_COMMON_PATH: ./Publish/ToUpload/ | ||
|
||
PUBLISH_GAMEBANANA_PATH: ./Publish/ToUpload/GameBanana | ||
PUBLISH_GITHUB_PATH: ./Publish/ToUpload/Generic | ||
PUBLISH_NUGET_PATH: ./Publish/ToUpload/NuGet | ||
|
||
PUBLISH_CHANGELOG_PATH: ./Publish/Changelog.md | ||
PUBLISH_PATH: ./Publish | ||
|
||
IS_RELEASE: ${{ startsWith(github.ref, 'refs/tags/') }} | ||
RELEASE_TAG: ${{ github.ref_name }} | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
defaults: | ||
run: | ||
shell: pwsh | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
submodules: 'recursive' | ||
|
||
- name: Setup .NET Core SDK (5.0) | ||
uses: actions/setup-dotnet@v1.8.2 | ||
with: | ||
dotnet-version: 5.0.x | ||
|
||
- name: Setup .NET Core SDK (6.0) | ||
uses: actions/setup-dotnet@v1.8.2 | ||
with: | ||
dotnet-version: 6.0.x | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Setup AutoChangelog | ||
run: npm install -g auto-changelog | ||
|
||
- name: Create Changelog | ||
run: | | ||
[System.IO.Directory]::CreateDirectory("$env:PUBLISH_PATH") | ||
if ($env:IS_RELEASE -eq 'true') { | ||
auto-changelog --sort-commits date --hide-credit --template keepachangelog --commit-limit false --starting-version "$env:RELEASE_TAG" --output "$env:PUBLISH_CHANGELOG_PATH" | ||
} | ||
else { | ||
auto-changelog --sort-commits date --hide-credit --template keepachangelog --commit-limit false --unreleased --output "$env:PUBLISH_CHANGELOG_PATH" | ||
} | ||
- name: Build | ||
run: ./Publish.ps1 -ChangelogPath "$env:PUBLISH_CHANGELOG_PATH" | ||
|
||
- name: Upload GitHub Release Artifact | ||
uses: actions/upload-artifact@v2.2.4 | ||
with: | ||
# Artifact name | ||
name: GitHub Release | ||
# A file, directory or wildcard pattern that describes what to upload | ||
path: | | ||
${{ env.PUBLISH_GITHUB_PATH }}/* | ||
- name: Upload GameBanana Release Artifact | ||
uses: actions/upload-artifact@v2.2.4 | ||
with: | ||
# Artifact name | ||
name: GameBanana Release | ||
# A file, directory or wildcard pattern that describes what to upload | ||
path: | | ||
${{ env.PUBLISH_GAMEBANANA_PATH }}/* | ||
- name: Upload NuGet Release Artifact | ||
uses: actions/upload-artifact@v2.2.4 | ||
with: | ||
# Artifact name | ||
name: NuGet Release | ||
# A file, directory or wildcard pattern that describes what to upload | ||
path: | | ||
${{ env.PUBLISH_NUGET_PATH }}/* | ||
- name: Upload Changelog Artifact | ||
uses: actions/upload-artifact@v2.2.4 | ||
with: | ||
# Artifact name | ||
name: Changelog | ||
# A file, directory or wildcard pattern that describes what to upload | ||
path: ${{ env.PUBLISH_CHANGELOG_PATH }} | ||
retention-days: 0 | ||
|
||
- name: Upload to GitHub Releases (on Tag) | ||
uses: softprops/action-gh-release@v0.1.14 | ||
if: env.IS_RELEASE == 'true' | ||
with: | ||
# Path to load note-worthy description of changes in release from | ||
body_path: ${{ env.PUBLISH_CHANGELOG_PATH }} | ||
# Newline-delimited list of path globs for asset files to upload | ||
files: | | ||
${{ env.PUBLISH_GITHUB_PATH }}/* | ||
- name: Push to NuGet (on Tag) | ||
env: | ||
NUGET_KEY: ${{ secrets.RELOADED_NUGET_KEY }} | ||
if: env.IS_RELEASE == 'true' | ||
run: | | ||
if ([string]::IsNullOrEmpty("$env:NUGET_KEY")) | ||
{ | ||
Write-Host "NuGet Repository Key (GitHub Secrets -> RELOADED_NUGET_KEY) Not Specified. Skipping." | ||
return | ||
} | ||
$items = Get-ChildItem -Path "$env:PUBLISH_NUGET_PATH/*.nupkg" | ||
Foreach ($item in $items) | ||
{ | ||
Write-Host "Pushing $item" | ||
dotnet nuget push "$item" -k "$env:NUGET_KEY" -s "http://packages.sewer56.moe:5000/v3/index.json" --skip-duplicate | ||
} |
Binary file added
BIN
+199 KB
source/Reloaded.Mod.Template/templates/configurable/.template.config/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions
64
source/Reloaded.Mod.Template/templates/configurable/.template.config/template.json
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,64 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/template", | ||
"author": "Sewer56", | ||
"classifications": [ | ||
"Common", | ||
"Library", | ||
"Games" | ||
], | ||
"name": "Reloaded II Mod Template", | ||
"description": "Template for a Reloaded-II modification.", | ||
"sourceName": "Reloaded.Mod.Template", | ||
"defaultName": "My Reloaded-II Mod", | ||
"identity": "Reloaded.Mod.Template", | ||
"shortName": "reloaded", | ||
"tags": { | ||
"language": "C#", | ||
"type": "project" | ||
}, | ||
"preferNameDirectory": true, | ||
"symbols": { | ||
"ModName": { | ||
"type": "parameter", | ||
"displayName": "Mod Name", | ||
"description": "Name of the mod as seen in the launcher.", | ||
"datatype": "text", | ||
"replaces": "ModNameValue", | ||
"defaultValue": "My Cool Reloaded Mod" | ||
}, | ||
"ModDescription": { | ||
"type": "parameter", | ||
"displayName": "Mod Description", | ||
"description": "Description of the mod as seen in the launcher.", | ||
"datatype": "text", | ||
"replaces": "ModDescriptionValue", | ||
"defaultValue": "Description" | ||
}, | ||
"ModAuthor": { | ||
"type": "parameter", | ||
"displayName": "Mod Author", | ||
"description": "Author of the mod as seen in the launcher.", | ||
"datatype": "text", | ||
"replaces": "ModAuthorValue", | ||
"defaultValue": "Me" | ||
}, | ||
"AddGitHubActions": { | ||
"type": "parameter", | ||
"displayName": "Add GitHub Actions", | ||
"dataType": "bool", | ||
"defaultValue": "true" | ||
} | ||
}, | ||
"sources": [ | ||
{ | ||
"modifiers": [ | ||
{ | ||
"condition": "(!AddGitHubActions)", | ||
"exclude": [ | ||
".github/workflows/reloaded.yml" | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
48 changes: 48 additions & 0 deletions
48
source/Reloaded.Mod.Template/templates/configurable/Configuration/Config.cs
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,48 @@ | ||
using Reloaded.Mod.Template.Configuration.Implementation; | ||
using System.ComponentModel; | ||
|
||
namespace Reloaded.Mod.Template.Configuration | ||
{ | ||
public class Config : Configurable<Config> | ||
{ | ||
/* | ||
User Properties: | ||
- Please put all of your configurable properties here. | ||
- Tip: Consider using the various available attributes https://stackoverflow.com/a/15051390/11106111 | ||
By default, configuration saves as "Config.json" in mod folder. | ||
Need more config files/classes? See Configuration.cs | ||
*/ | ||
|
||
|
||
[DisplayName("String")] | ||
[Description("This is a string.")] | ||
public string String { get; set; } = "Default Name"; | ||
|
||
[DisplayName("Int")] | ||
[Description("This is an int.")] | ||
public int Integer { get; set; } = 42; | ||
|
||
[DisplayName("Bool")] | ||
[Description("This is a bool.")] | ||
public bool Boolean { get; set; } = true; | ||
|
||
[DisplayName("Float")] | ||
[Description("This is a floating point number.")] | ||
public float Float { get; set; } = 6.987654F; | ||
|
||
[DisplayName("Enum")] | ||
[Description("This is an enumerable.")] | ||
public SampleEnum Reloaded { get; set; } = SampleEnum.ILoveIt; | ||
|
||
public enum SampleEnum | ||
{ | ||
NoOpinion, | ||
Sucks, | ||
IsMediocre, | ||
IsOk, | ||
IsCool, | ||
ILoveIt | ||
} | ||
} | ||
} |
Oops, something went wrong.