Skip to content

Commit

Permalink
fixed MonkeyLoader tests, added SemVer check for releases (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpmxyz authored Dec 16, 2023
1 parent 599c7a1 commit e5a1ff3
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
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>

0 comments on commit e5a1ff3

Please sign in to comment.