summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-12-03 02:16:27 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-12-03 02:16:27 -0500
commite4416925f9b4d1deac521c62918d008076ac6b05 (patch)
treeb882f3225a6ad05b995bca373513fce107e6b8ce
parent181508084b5bb2bb7b8cd61ec3193a293300ba45 (diff)
downloadSMAPI-e4416925f9b4d1deac521c62918d008076ac6b05.tar.gz
SMAPI-e4416925f9b4d1deac521c62918d008076ac6b05.tar.bz2
SMAPI-e4416925f9b4d1deac521c62918d008076ac6b05.zip
add build script to set the release version
-rwxr-xr-xbuild/set-smapi-version.sh18
-rw-r--r--docs/technical/smapi.md13
-rw-r--r--src/SMAPI.sln1
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}"