Skip to content

Commit

Permalink
Release v1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
IAmBatby committed Jul 24, 2024
1 parent 2e5a92c commit 2fd59f1
Show file tree
Hide file tree
Showing 8 changed files with 268 additions and 1 deletion.
75 changes: 75 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build

on:
# Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g., for dependabot pull requests)
push:
branches: [main]
# Trigger the workflow on any pull request
pull_request:
workflow_call:
inputs:
ref:
description: "A tag reference passed from Publish workflow"
default: ${{ github.sha }}
required: false
type: string

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
fetch-depth: 0
filter: tree:0

- name: Setup .NET environment
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.100"

- name: Install Evaisa's netcode-patcher
run: |
dotnet tool install -g Evaisa.NetcodePatcher.Cli
- name: Restore project
run: |
dotnet restore
dotnet tool restore
- name: Build and pack solution
run: |
dotnet pack -c Release
- name: Set MOD_NAME environment variable
run: echo "MOD_NAME=$(cat ./*/dist/name.txt )" >> $GITHUB_ENV

- name: Set MOD_VERSION environment variable
run: echo "MOD_VERSION=$(cat ./*/dist/version.txt )" >> $GITHUB_ENV

- name: Set ZIP_PATH environment variable
run: echo "ZIP_PATH=./${{ env.MOD_NAME }}/dist/curseforge.zip" >> $GITHUB_ENV

- name: Upload CurseForge artifact
uses: actions/upload-artifact@v4
with:
name: curseforge-build
path: ${{ env.ZIP_PATH }}

- name: Upload Thunderstore artifact
uses: actions/upload-artifact@v4
with:
name: thunderstore-build
path: ./*/dist/*.zip

- name: Upload nupkg artifact
uses: actions/upload-artifact@v4
with:
name: nupkg-build
path: ./*/bin/Release/*.nupkg

- name: Upload Versions artifact
uses: actions/upload-artifact@v4
with:
name: versions
path: ./*/dist/*.txt
46 changes: 46 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish

on:
release:
types: [prereleased, released]

jobs:
build:
uses: ./.github/workflows/build.yml
with:
ref: ${{ github.event.release.tag_name }}

upload-release-artifacts:
name: Add artifacts to Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v4

- name: Download all artifacts
uses: actions/download-artifact@v4

- name: Upload artifacts to Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB }}
run: gh release upload ${{ github.event.release.tag_name }} thunderstore-build/*/dist/*.zip nupkg-build/*/bin/Release/*.nupkg

release-curseforge:
needs: build
uses: ./.github/workflows/release-curseforge.yml
secrets:
curseforge-token: ${{ secrets.CURSEFORGE_API_KEY }}
project-id: ${{ secrets.CURSEFORGE_PROJECTID }}

release-thunderstore:
needs: build
uses: ./.github/workflows/release-thunderstore.yml
secrets:
thunderstore-token: ${{ secrets.THUNDERSTORE_API_KEY }}

release-nuget:
needs: build
uses: ./.github/workflows/release-nuget.yml
secrets:
nuget-token: ${{ secrets.NUGET_API_KEY }}
46 changes: 46 additions & 0 deletions .github/workflows/release-curseforge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release on Curseforge

on:
workflow_call:
secrets:
curseforge-token:
required: true
project-id:
required: true

jobs:
curseforge:
name: Upload
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v4

- name: Download Curseforge artifact
uses: actions/download-artifact@v4
with:
name: curseforge-build

- name: Download Versions artifact
uses: actions/download-artifact@v4
with:
name: versions

- name: Set MOD_NAME environment variable
run: echo "MOD_NAME=$(cat ./*/dist/name.txt )" >> $GITHUB_ENV

- name: Set MOD_VERSION environment variable
run: echo "MOD_VERSION=$(cat ./*/dist/version.txt )" >> $GITHUB_ENV

- name: Set ZIP_PATH environment variable
run: echo "ZIP_PATH=./${{ env.MOD_NAME }}/dist/curseforge.zip" >> $GITHUB_ENV

- name: "Upload to CurseForge"
uses: itsmeow/curseforge-upload@v3
with:
token: ${{ secrets.curseforge-token }}
project_id: ${{ secrets.project-id }}
game_endpoint: "lethal-company"
game_versions: "0.50.0"
file_path: ${{ env.ZIP_PATH }}
display_name: ${{ env.MOD_NAME }} v${{ env.MOD_VERSION }}
29 changes: 29 additions & 0 deletions .github/workflows/release-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release on Nuget

on:
workflow_call:
secrets:
nuget-token:
required: true

jobs:
nuget:
name: Upload
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v4

- name: Download nupkg artifact
uses: actions/download-artifact@v4
with:
name: nupkg-build

- name: Setup .NET environment
uses: actions/setup-dotnet@v3
with:
dotnet-version: "8.0.100"

- name: Publish to NuGet.org
run: |
dotnet nuget push ./*/bin/Release/*.nupkg --api-key ${{ secrets.nuget-token }} --source https://api.nuget.org/v3/index.json
37 changes: 37 additions & 0 deletions .github/workflows/release-thunderstore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release on Thunderstore

on:
workflow_call:
secrets:
thunderstore-token:
required: true

jobs:
thunderstore:
name: Upload
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v4

- name: Download Thunderstore artifact
uses: actions/download-artifact@v4
with:
name: thunderstore-build

- name: Setup .NET environment
uses: actions/setup-dotnet@v3
with:
dotnet-version: "8.0.100"

- name: Install Evaisa's netcode-patcher
run: |
dotnet tool install -g Evaisa.NetcodePatcher.Cli
- name: Restore dotnet tools
run: |
dotnet tool restore
- name: Publish to Thunderstore
env:
TCLI_AUTH_TOKEN: ${{ secrets.thunderstore-token }}
run: |
dotnet build -target:PublishThunderstore
7 changes: 7 additions & 0 deletions LethalLevelLoader/General/Content.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ public static List<ExtendedLevel> CustomExtendedLevels
}
}

[Obsolete("Use PatchedContent.SelectableLevels instead.")] // probably used by no mod, but this is public so we should be careful
public static List<SelectableLevel> SeletectableLevels
{
get { return (SelectableLevels); }
}



public static List<SelectableLevel> SelectableLevels
{
Expand Down
18 changes: 17 additions & 1 deletion LethalLevelLoader/LethalLevelLoader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,25 @@
<Exec Command="dotnet tcli build --config-path $(ProjectDir)../assets/thunderstore.toml" />

<ItemGroup>
<FilesToRename Include="$(ProjectDir)dist/*IAmBatby-$(AssemblyName)-$(PlainVersion).zip" />
<FilesToRename Include="$(ProjectDir)dist/*-$(PlainVersion).zip" />
</ItemGroup>
<Move SourceFiles="@(FilesToRename)" DestinationFiles="@(FilesToRename -&gt; Replace($(PlainVersion), $(MinVerVersion)))" />
</Target>

<!-- thunderstore publish -->
<Target Name="PublishThunderstore" DependsOnTargets="SetPluginVersion;SaveVersionAndNameToFiles">
<Exec Command="dotnet tcli publish --config-path $(ProjectDir)../assets/thunderstore.toml --file $(ProjectDir)dist/*-$(MinVerVersion).zip" />
</Target>

<!-- zipping the .dll alone for curseforge release -->
<Target Name="ZipCurseForge" AfterTargets="PackThunderstore">
<MakeDir Directories="$(ProjectDir)dist/output/" Condition="!Exists('$(ProjectDir)dist/output/')" />
<Copy SourceFiles="$(ProjectDir)bin/Release/netstandard2.1/$(AssemblyName).dll" DestinationFiles="$(ProjectDir)dist/output/$(AssemblyName).dll" />

<ZipDirectory
SourceDirectory="$(ProjectDir)dist/output/"
DestinationFile="$(ProjectDir)dist/curseforge.zip"
Overwrite="true" />
</Target>

</Project>
11 changes: 11 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "LethalLevelLoader",
"version_number": "1.3.1",
"website_url": "https://github.com/IAmBatby/LethalLevelLoader",
"description": "A Custom API to support the manual and dynamic integration of all forms of custom content in Lethal Company. (v56 Compatible)",
"dependencies": [
"Evaisa-FixPluginTypesSerialization-1.1.1",
"MaxWasUnavailable-LethalModDataLib-1.2.2",
"BepInEx-BepInExPack-5.4.2100"
]
}

0 comments on commit 2fd59f1

Please sign in to comment.