diff options
-rwxr-xr-x | build/set-smapi-version.sh | 18 | ||||
-rw-r--r-- | docs/technical/smapi.md | 13 | ||||
-rw-r--r-- | src/SMAPI.sln | 1 |
3 files changed, 25 insertions, 7 deletions
diff --git a/build/set-smapi-version.sh b/build/set-smapi-version.sh new file mode 100755 index 00000000..42174cae --- /dev/null +++ b/build/set-smapi-version.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# get version number +version="$1" +if [ $# -eq 0 ]; then + echo "SMAPI release version (like '4.0.0'):" + read version +fi + +# move to SMAPI root +cd "`dirname "$0"`/.." + +# apply changes +sed "s/<Version>.+<\/Version>/<Version>$version<\/Version>/" "build/common.targets" --in-place --regexp-extended +sed "s/RawApiVersion = \".+?\";/RawApiVersion = \"$version\";/" "src/SMAPI/Constants.cs" --in-place --regexp-extended +for modName in "ConsoleCommands" "ErrorHandler" "SaveBackup"; do + sed "s/\"(Version|MinimumApiVersion)\": \".+?\"/\"\1\": \"$version\"/g" "src/SMAPI.Mods.$modName/manifest.json" --in-place --regexp-extended +done diff --git a/docs/technical/smapi.md b/docs/technical/smapi.md index ce1220f1..f2e030d8 100644 --- a/docs/technical/smapi.md +++ b/docs/technical/smapi.md @@ -116,16 +116,15 @@ To launch the game: 2. Launch the game through the Steam UI. #### Prepare the release -1. Update the version numbers in `build/common.targets`, `Constants`, and the `manifest.json` for - bundled mods. Make sure you use a [semantic version](https://semver.org). Recommended format: +1. Run `build/set-smapi-version.sh` to set the SMAPI version. Make sure you use a [semantic + version](https://semver.org). Recommended format: build type | format | example :--------- | :----------------------- | :------ - dev build | `<version>-alpha.<date>` | `3.0.0-alpha.20171230` - prerelease | `<version>-beta.<date>` | `3.0.0-beta.20171230` - release | `<version>` | `3.0.0` -2. Run the `build/prepare-install-package.sh` script. This will create the release package in the - root `bin` folder. + dev build | `<version>-alpha.<date>` | `4.0.0-alpha.20251230` + prerelease | `<version>-beta.<date>` | `4.0.0-beta.20251230` + release | `<version>` | `4.0.0` +2. Run `build/prepare-install-package.sh` to create the release package in the root `bin` folder. ### Custom Harmony build SMAPI uses [a custom build of Harmony](https://github.com/Pathoschild/Harmony#readme), which is diff --git a/src/SMAPI.sln b/src/SMAPI.sln index 9a42b9ff..961a5ff7 100644 --- a/src/SMAPI.sln +++ b/src/SMAPI.sln @@ -29,6 +29,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{09CF91E5 ..\build\common.targets = ..\build\common.targets ..\build\find-game-folder.targets = ..\build\find-game-folder.targets ..\build\prepare-install-package.sh = ..\build\prepare-install-package.sh + ..\build\set-smapi-version.sh = ..\build\set-smapi-version.sh EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{EB35A917-67B9-4EFA-8DFC-4FB49B3949BB}" |