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

fixed MonkeyLoader tests, added SemVer check for releases #32

Merged
merged 12 commits into from
Dec 16, 2023
16 changes: 14 additions & 2 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ on:
type: string
required: false
description: "Title"
default: ""
description:
type: string
required: true
description: "Description of changes"
default: ""
release-rml:
type: boolean
required: false
Expand All @@ -30,12 +30,23 @@ on:
env:
NUGET_PUBLISH_TARGET: "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
ARTIFACT_NAME: SampleMod
RML_MANIFEST_TOKEN: "${{ secrets.RML_MANIFEST_TOKEN }}"
name: "Create Release"
jobs:
check-inputs:
runs-on: ubuntu-latest
steps:
- name: "Check version format"
env:
RELEASE_VERSION: "${{ inputs.version }}"
shell: bash
run: |
# https://semver.org/ applied to https://stackoverflow.com/questions/21112707/check-if-a-string-matches-a-regex-in-bash-script
[[ "$RELEASE_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-]+)*))?$ ]]

compile-rml:
if: ${{ inputs.release-rml }}
uses: ./.github/workflows/build-rml.yml
needs: check-inputs
with:
RELEASE_VERSION: "${{ inputs.version }}"
RELEASE_NOTES: "${{ inputs.description }}"
Expand All @@ -44,6 +55,7 @@ jobs:
compile-monkey:
if: ${{ inputs.release-monkey }}
uses: ./.github/workflows/build-monkey.yml
needs: check-inputs
with:
RELEASE_VERSION: "${{ inputs.version }}"
RELEASE_NOTES: "${{ inputs.description }}"
Expand Down
2 changes: 1 addition & 1 deletion SampleMod.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Product>SampleMod</Product>
<Description>A sample Resonite Mod</Description>
<Copyright>CC0</Copyright>
<Version>1.0.4</Version>
<Version>1.1.0</Version>
<PackageProjectUrl>$(PROJECT_URL)</PackageProjectUrl>
<PackageReleaseNotes>$(RELEASE_NOTES)</PackageReleaseNotes>
<PackageTags>Resonite</PackageTags>
Expand Down
2 changes: 1 addition & 1 deletion SampleModRML.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class SampleModRML : ResoniteMod, ISampleMod
{
public override string Name => "SampleMod";
public override string Author => "mpmxyz";
public override string Version => "1.0.4"; //Version of the mod, should match the AssemblyVersion
public override string Version => "1.1.0"; //Version of the mod, should match the AssemblyVersion
public override string Link => "https://github.com/mpmxyz/ResoniteSampleMod";


Expand Down
3 changes: 3 additions & 0 deletions TestMonkey/TestMonkey.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
<Compile Remove="obj\Common\Release\net472\TestMonkey.AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="Harmony">
<HintPath>$(ResonitePath)\0Harmony.dll</HintPath>
</Reference>
<Reference Include="MonkeyLoader">
<HintPath>$(ResonitePath)\MonkeyLoader.dll</HintPath>
</Reference>
Expand Down
6 changes: 6 additions & 0 deletions TestRML/TestRML.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Reference Include="Harmony">
<HintPath>$(ResonitePath)\rml_libs\0Harmony.dll</HintPath>
</Reference>
<Reference Include="ResoniteModLoader">
<HintPath>$(ResonitePath)\Libraries\ResoniteModLoader.dll</HintPath>
</Reference>
<ProjectReference Include="..\SampleModRML.csproj" />
</ItemGroup>
</Project>