Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.8.0 New entries, fixes, refactor #34

Merged
merged 20 commits into from
Feb 21, 2024
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
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build

on:
push:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true

- name: Build the solution
run: dotnet build "MicroEngineer.sln" -c Release

- name: Find zip
id: find-zip
run: |
echo "zip=$(ls -1 dist/MicroEngineer-*.zip | head -n 1)" >> $GITHUB_ENV
echo "artifact_name=MicroEngineerRelease" >> $GITHUB_ENV

- name: Upload zip artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name }}
path: ${{ env.zip }}

63 changes: 63 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Upload release

env:
SPACEDOCK_MOD_ID: fill_in_your_mod_id_here

on:
release:
types: [ "published" ]

jobs:
publish:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true

- name: Download NuGet
id: download-nuget
run: sudo curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe

- name: Install jq
uses: dcarbone/[email protected]

- name: Build the solution
run: dotnet build "MicroEngineer.sln" -c Release

- name: Extract current version
id: get-version
run: |
version=$(jq -r '.version' plugin_template/swinfo.json)
echo "Version is $version"
echo "version=$version" >> $GITHUB_ENV
echo "release_filename=MicroEngineer-$version.zip" >> $GITHUB_ENV
echo "zip=$(ls -1 dist/MicroEngineer-*.zip | head -n 1)" >> $GITHUB_ENV
echo "upload_url=$(wget -qO- https://api.github.com/repos/$GITHUB_REPOSITORY/releases | jq '.[0].upload_url' | tr -d \")" >> $GITHUB_ENV
wget -qO- https://api.github.com/repos/$GITHUB_REPOSITORY/releases | jq -r '.[0].body' > ./changelog.md

- name: Upload zip to release
uses: shogo82148/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.upload_url }}
asset_path: ${{ env.zip }}
asset_name: ${{ env.release_filename }}
asset_content_type: application/zip

# - name: Add Mask
# run: echo "::add-mask::${{ secrets.SPACEDOCK_PASSWORD }}"
#
# - name: Update mod on SpaceDock
# uses: KSP2Community/[email protected]
# with:
# username: ${{ secrets.SPACEDOCK_USER }}
# password: ${{ secrets.SPACEDOCK_PASSWORD }}
# game_id: 22407
# mod_id: ${{ env.SPACEDOCK_MOD_ID }}
# version: ${{ env.version }}
# zipball: ${{ env.zip }}
# changelog: ./changelog.md
16 changes: 16 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Verify swinfo.json

on:
push:
branches: [ "main" ]

jobs:
verify:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Verify KSP2 Mod
uses: Rexicon226/[email protected]
69 changes: 48 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,51 @@
*.rsuser
# General C# project
*.suo
*.user
*.userosscache
*.sln.docstates
*.userprefs
mono_crash.*
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
MicroEngineerProject/[Bb]in/
.vs/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
/MicroEngineerProject/.vs
/MicroEngineerProject/.vs/*
/Staging/CopyStagingToGame.bat
*.bat
_UpgradeReport_Files/
/[Pp]ackages/

# Mod template folders
/[Bb]uild/
/[Dd]ist/
/[Nn]uget/

# Rider

# User specific
**/.idea/**/workspace.xml
**/.idea/**/tasks.xml
**/.idea/shelf/*
**/.idea/dictionaries
**/.idea/httpRequests/

# Sensitive or high-churn files
**/.idea/**/dataSources/
**/.idea/**/dataSources.ids
**/.idea/**/dataSources.xml
**/.idea/**/dataSources.local.xml
**/.idea/**/sqlDataSources.xml
**/.idea/**/dynamic.xml

# Rider auto-generates .iml files, and contentModel.xml
**/.idea/**/*.iml
**/.idea/**/contentModel.xml
**/.idea/**/modules.xml

# VS Code files
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# Local History for Visual Studio Code
.history/

# OS-specific
Thumbs.db
Desktop.ini
.DS_Store

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 60 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup Label="Framework and language configuration">
<TargetFramework>netstandard2.1</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>

<PropertyGroup Label="Game folder configuration">
<!-- Set this to the path to your KSP 2 folder if you don't have the KSP2DIR environmental variable set -->
<KSP2DIR Condition="'$(KSP2DIR)' == ''">C:/Program Files (x86)/Steam/steamapps/common/Kerbal Space Program 2</KSP2DIR>
</PropertyGroup>

<PropertyGroup Label="Build and namespace configuration">
<SolutionDir Condition="'$(SolutionDir)'==''">$(MSBuildThisFileDirectory)</SolutionDir>
<PluginBinPath>$(SolutionDir)build/bin/plugin/$(Configuration)</PluginBinPath>
<PluginObjPath>$(SolutionDir)build/obj/plugin/$(Configuration)</PluginObjPath>
<BaseOutputPath>$(PluginBinPath)/$(MSBuildProjectName)</BaseOutputPath>
<BaseIntermediateOutputPath>$(PluginObjPath)/$(MSBuildProjectName)</BaseIntermediateOutputPath>
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
<RootNamespace>$(AssemblyName)</RootNamespace>
<Configurations>Debug;Release;Deploy;DeployAndRun</Configurations>
<Platforms>AnyCPU</Platforms>
<NoWarn>$(NoWarn);CS0436</NoWarn>
</PropertyGroup>

<PropertyGroup Label="Package source configuration">
<RestoreAdditionalProjectSources>
https://nuget.spacewarp.org/v3/index.json
</RestoreAdditionalProjectSources>
</PropertyGroup>

<ItemGroup Label="Dependencies for build targets">
<PackageReference Include="JsonPeek" Version="1.2.0" PrivateAssets="all"/>
</ItemGroup>

<!-- Define the main target -->
<Target Label="Reading properties from swinfo.json" Name="ReadPropertiesFromJson" BeforeTargets="PreBuildEvent;AddGeneratedFile">
<JsonPeek ContentPath="$(SolutionDir)/plugin_template/swinfo.json" Query="$">
<Output TaskParameter="Result" ItemName="Swinfo"/>
</JsonPeek>

<!-- Extract properties from the JSON -->
<PropertyGroup>
<ModId>@(Swinfo -> '%(mod_id)')</ModId>
<Version>@(Swinfo -> '%(version)')</Version>
<Version Condition="$(Version.Contains('-'))">$(Version.Substring(0, $(Version.IndexOf('-'))))</Version>
<Product>@(Swinfo -> '%(name)')</Product>
<Authors>@(Swinfo -> '%(author)')</Authors>
<Description>@(Swinfo -> '%(description)')</Description>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>@(Swinfo -> '%(source)')</RepositoryUrl>
<SpaceWarpPluginGuid>$(ModId)</SpaceWarpPluginGuid>
<SpaceWarpPluginName>$(Product)</SpaceWarpPluginName>
<SpaceWarpPluginVersion>$(Version)</SpaceWarpPluginVersion>
</PropertyGroup>
</Target>
</Project>

4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Micrologist, Falki-git
Copyright (c) 2024 Falki-git

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
34 changes: 34 additions & 0 deletions MicroEngineer.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{DDED7544-C61F-43BC-BEF3-5E503E90E32F}") = "MicroEngineer", "src/MicroEngineer/MicroEngineer.csproj", "{1DEA6560-49BA-437D-A1E3-25930D9C9647}"
EndProject
Project("{DDED7544-C61F-43BC-BEF3-5E503E90E32F}") = "MicroEngineer.Unity", "src/MicroEngineer.Unity/MicroEngineer.Unity.csproj", "{287E3D0C-2FCB-4E5A-9C0C-0EE99066CB4E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Deploy|Any CPU = Deploy|Any CPU
DeployAndRun|Any CPU = DeployAndRun|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1DEA6560-49BA-437D-A1E3-25930D9C9647}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1DEA6560-49BA-437D-A1E3-25930D9C9647}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1DEA6560-49BA-437D-A1E3-25930D9C9647}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1DEA6560-49BA-437D-A1E3-25930D9C9647}.Release|Any CPU.Build.0 = Release|Any CPU
{1DEA6560-49BA-437D-A1E3-25930D9C9647}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU
{1DEA6560-49BA-437D-A1E3-25930D9C9647}.Deploy|Any CPU.Build.0 = Deploy|Any CPU
{1DEA6560-49BA-437D-A1E3-25930D9C9647}.DeployAndRun|Any CPU.ActiveCfg = DeployAndRun|Any CPU
{1DEA6560-49BA-437D-A1E3-25930D9C9647}.DeployAndRun|Any CPU.Build.0 = DeployAndRun|Any CPU
{287E3D0C-2FCB-4E5A-9C0C-0EE99066CB4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{287E3D0C-2FCB-4E5A-9C0C-0EE99066CB4E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{287E3D0C-2FCB-4E5A-9C0C-0EE99066CB4E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{287E3D0C-2FCB-4E5A-9C0C-0EE99066CB4E}.Release|Any CPU.Build.0 = Release|Any CPU
{287E3D0C-2FCB-4E5A-9C0C-0EE99066CB4E}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU
{287E3D0C-2FCB-4E5A-9C0C-0EE99066CB4E}.Deploy|Any CPU.Build.0 = Deploy|Any CPU
{287E3D0C-2FCB-4E5A-9C0C-0EE99066CB4E}.DeployAndRun|Any CPU.ActiveCfg = DeployAndRun|Any CPU
{287E3D0C-2FCB-4E5A-9C0C-0EE99066CB4E}.DeployAndRun|Any CPU.Build.0 = DeployAndRun|Any CPU
EndGlobalSection
EndGlobal


26 changes: 0 additions & 26 deletions MicroEngineerProject/MicroEngineer.csproj

This file was deleted.

25 changes: 0 additions & 25 deletions MicroEngineerProject/MicroEngineer.sln

This file was deleted.

Loading
Loading