modrinth: support excluding mods from modpack (#2524)

This commit is contained in:
Geoff Bourne 2023-12-03 14:13:40 -06:00 committed by GitHub
parent 2507028193
commit c0c6e6d78d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 11 deletions

View File

@ -49,7 +49,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=${MC_SERVER_RUNNER_VERSION} --var app=mc-server-runner --file {{.app}} \
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
ARG MC_HELPER_VERSION=1.37.2
ARG MC_HELPER_VERSION=1.37.3
ARG MC_HELPER_BASE_URL=${GITHUB_BASEURL}/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
# used for cache busting local copy of mc-image-helper
ARG MC_HELPER_REV=1

View File

@ -65,32 +65,38 @@ VERSION=1.12.2 /scripts/start-magma
> NOTE: You may want to temporarily add an `exit` statement near the end of your script to isolate execution to just the script you're developing.
## Using development copy of mc-image-helper
## Using development copy of tools
In the cloned copy of [`mc-image-helper`](https://github.com/itzg/mc-image-helper), create an up-to-date snapshot build of the tgz distribution using:
In the cloned repo, such as [`mc-image-helper`](https://github.com/itzg/mc-image-helper), create an up-to-date snapshot build of the tgz distribution using:
```shell
./gradlew distTar
```
!!! note
The distribution's version will be `0.0.0-<branch>-SNAPSHOT`
Assuming Java 18 or newer:
For Go base tools, run
```shell
cd build/distributions
jwebserver -b 0.0.0.0 -p 8008
goreleaser release --snapshot --clean
```
If `jwebserver` is not available, try `java -m jdk.httpserver -p 8008`
Clone [itzg/github-releases-proxy](https://github.com/itzg/github-releases-proxy) and run it according to the instructions shown there.
In the Docker build, configure the following
```shell
--build-arg MC_HELPER_VERSION=1.8.1-SNAPSHOT \
--build-arg MC_HELPER_BASE_URL=http://host.docker.internal:8008
--build-arg GITHUB_BASEURL=http://host.docker.internal:8080 \
--build-arg APPS_REV=1
```
Now the image can be built like normal, and it will install mc-image-helper from the locally built copy.
and declare one or more version overrides, such as
```
--build-arg MC_HELPER_VERSION=1.8.1-SNAPSHOT
```
## Generating release notes

View File

@ -8,7 +8,7 @@ To manage a CurseForge modpack automatically with upgrade support, pinned or lat
A CurseForge API key is **required** to use this feature. Go to their [developer console](https://console.curseforge.com/), generate an API key, and set the environment variable `CF_API_KEY`.
When entering your API Key in a docker compose file you will need to escape any `$` character with a second `$`.
When entering your API Key in a docker compose file you will need to escape any `$` character with a second `$`. Refer to [this compose file reference section](https://docs.docker.com/compose/compose-file/compose-file-v3/#variable-substitution) for more information.
Example if your key is `$11$22$33aaaaaaaaaaaaaaaaaaaaaaaaaa`:
```yaml

View File

@ -41,3 +41,16 @@ Some mods, such as [MCInstance Loader](https://modrinth.com/mod/mcinstance-loade
config/mcinstanceloader/pack.mcinstance
```
## Excluding files
To exclude client mods that are incorrectly declared by the modpack as server-compatible, set `MODRINTH_EXCLUDE_FILES` to a comma or newline delimited list of partial file names to exclude. You may need to set `MODRINTH_FORCE_SYNCHRONIZE` to "true" while iterating on a compatible set of mods to use.
!!! example
In a Compose file:
```yaml
MODRINTH_EXCLUDE_FILES: |
notenoughanimations
lambdynamiclights
euphoriapatcher
```

View File

@ -52,6 +52,7 @@ setArg() {
setArg --loader MODRINTH_LOADER
setArg --version MODRINTH_VERSION
setArg --default-version-type MODRINTH_DEFAULT_VERSION_TYPE
setArg --exclude-files MODRINTH_EXCLUDE_FILES
if ! mc-image-helper install-modrinth-modpack "${args[@]}"; then
log "ERROR failed to install Modrinth modpack"