diff --git a/.github/workflows/upload_all.yml b/.github/workflows/upload_all.yml index 91dbc834..d60d5cd2 100644 --- a/.github/workflows/upload_all.yml +++ b/.github/workflows/upload_all.yml @@ -21,4 +21,10 @@ jobs: upload_nuget: name: NuGet - uses: ./.github/workflows/upload_nuget.yml \ No newline at end of file + uses: ./.github/workflows/upload_nuget.yml + + upload_thunderstore: + name: Thunderstore + uses: ./.github/workflows/upload_thunderstore.yml + with: + VERSION: ${{ inputs.VERSION }} \ No newline at end of file diff --git a/.github/workflows/upload_thunderstore.yml b/.github/workflows/upload_thunderstore.yml new file mode 100644 index 00000000..f1fc52b0 --- /dev/null +++ b/.github/workflows/upload_thunderstore.yml @@ -0,0 +1,57 @@ +on: + workflow_call: + VERSION: + required: true + type: string + +jobs: + upload_nuget: + name: Upload NuGet Package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup dotnet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 9.0.x + + - name: Install Digitalroot.ModUploader + run: | + dotnet tool install -g Digitalroot.ModUploader + + - name: Download Windows x64 Artifact + uses: actions/download-artifact@v4 + with: + name: MelonLoader.Windows.x64.CI.Release + path: ./compiled_release/windows_x64 + + - name: Copy Missing Files + run: | + cp icon.png compiled_release/windows_x64/icon.png + cp compiled_release/windows_x64/MelonLoader/Documentation/README.md compiled_release/windows_x64/README.md + + - name: Generate manifest.json + run: | + cat < compiled_release/windows_x64/manifest.json + { + "name": MelonLoader, + "version_number": "${{ inputs.VERSION }}", + "website_url": "https://github.com/${{ github.repository }}", + "description": "The World's First Universal Mod Loader for Unity Games compatible with both Il2Cpp and Mono", + "dependencies": [] + } + EOF + + - name: Package Zip Archive + run: | + cd compiled_release/windows_x64 + zip -r ../${{ github.repository_owner }}-MelonLoader-${{ inputs.VERSION }}.zip ./ + + - name: Upload to Thunderstore + run: | + ModUploader \ + --file ${{ github.repository_owner }}-MelonLoader-${{ inputs.VERSION }}.zip \ + --token "${{ secrets.THUNDERSTORE_API_KEY }}" \ + --namespace "${{ github.repository_owner }}" \ + --community "${{ vars.THUNDERSTORE_COMMUNITY }}" \ No newline at end of file diff --git a/icon.png b/icon.png new file mode 100644 index 00000000..1b8a199a Binary files /dev/null and b/icon.png differ