Skip to content

Update for Mimesis 0.3.0 / MelonLoader 0.7.3 + portable build config … #6

Update for Mimesis 0.3.0 / MelonLoader 0.7.3 + portable build config …

Update for Mimesis 0.3.0 / MelonLoader 0.7.3 + portable build config … #6

Workflow file for this run

name: Build and Release on Tag
on:
push:
tags:
- "*.*"
permissions:
contents: write
packages: write
jobs:
build:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.extract-version.outputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout Workspace repository
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/Mimesis-Workspace
path: Workspace
ssh-key: ${{ secrets.WORKSPACE_TOKEN }}
- name: Extract version (remove v prefix)
id: extract-version
run: |
TAG="${{ github.ref_name }}"
VERSION="${TAG#v}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Build the project
run: >
dotnet build "MimicAPI/MimicAPI.csproj" --configuration Release
/p:WorkspaceLibPath="${{ github.workspace }}/Workspace/lib"
/p:GameManagedPath="${{ github.workspace }}/Workspace/lib/game"
/p:GameAssemblyPath="${{ github.workspace }}/Workspace/lib/game"
/p:MelonLoaderPath="${{ github.workspace }}/Workspace/lib/melonloader"
- name: Prepare release directory
run: |
mkdir -p release
cp MimicAPI/bin/Release/netstandard2.1/MimicAPI.dll release/
if [ -d "thunderstore" ]; then
cp -r thunderstore/* release/ 2>/dev/null || true
# Update version in manifest.json if it exists
if [ -f "release/manifest.json" ]; then
sed -i "s/\"version_number\": \".*\"/\"version_number\": \"${{ steps.extract-version.outputs.version }}\"/" release/manifest.json
fi
fi
- name: Create release ZIP
run: zip -j "MimicAPI_${{ steps.extract-version.outputs.version }}.zip" release/*
- name: Upload Release ZIP
uses: actions/upload-artifact@v4
with:
name: MimicAPI
path: "MimicAPI_${{ steps.extract-version.outputs.version }}.zip"
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download built ZIP
uses: actions/download-artifact@v4
with:
name: MimicAPI
- name: Extract DLL from ZIP
run: |
mkdir -p release
unzip -q "MimicAPI_${{ needs.build.outputs.version }}.zip" -d release/
ls -la release/
- name: Publish GitHub Release
uses: softprops/action-gh-release@v1
with:
files: release/MimicAPI.dll
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
thunderstore:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download built ZIP
uses: actions/download-artifact@v4
with:
name: MimicAPI
- name: Extract ZIP for Thunderstore
run: |
mkdir -p thunderstore-package
unzip -q "MimicAPI_${{ needs.build.outputs.version }}.zip" -d thunderstore-package/
- name: Upload to Thunderstore
uses: GreenTF/upload-thunderstore-package@v4.3
with:
token: ${{ secrets.THUNDERSTORE_TOKEN }}
community: mimesis
namespace: NeoMimicry
name: MimicAPI
description: a API!
version: ${{ needs.build.outputs.version }}
repo: mimesis.thunderstore.io
path: thunderstore-package
categories: |
Mods