Skip to content

Commit 1e4dc88

Browse files
committed
Add script to publish releases everywhere
- GitHub godot-builds - Web editor - NuGet - MavenCentral Still missing instructions for uploading stable releases to stores, etc.
1 parent 8c176b4 commit 1e4dc88

File tree

3 files changed

+107
-62
lines changed

3 files changed

+107
-62
lines changed

build-release.sh

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -88,54 +88,21 @@ sign_macos_template() {
8888
ssh "${OSX_HOST}" "rm -rf ${_macos_tmpdir}"
8989
}
9090

91-
can_publish_nuget=0
92-
if [ ! -z "${NUGET_SOURCE}" ] && [ ! -z "${NUGET_API_KEY}" ] && [[ $(type -P "dotnet") ]]; then
93-
can_publish_nuget=1
94-
else
95-
echo "Disabling NuGet package publishing as config.sh does not define the required data (NUGET_SOURCE, NUGET_API_KEY), or dotnet can't be found in PATH."
96-
fi
97-
98-
publish_nuget_packages() {
99-
if [ $can_publish_nuget == 0 ]; then
100-
return
101-
fi
102-
for pkg in "$@"; do
103-
dotnet nuget push $pkg --source "${NUGET_SOURCE}" --api-key "${NUGET_API_KEY}" --skip-duplicate
104-
done
105-
}
106-
107-
can_publish_maven=0
108-
if [ ! -d "${basedir}/deps/keystore" ]; then
109-
echo "Disabling Android library publishing as ${basedir}/deps/keystore doesn't exist."
110-
else
111-
can_publish_maven=1
112-
fi
113-
114-
publish_maven_library() {
115-
if [ $can_publish_maven == 0 ]; then
116-
return
117-
fi
118-
sh build-android/upload-mavencentral.sh
119-
}
120-
12191
godot_version=""
12292
templates_version=""
12393
do_cleanup=1
12494
make_tarball=1
12595
build_classical=1
12696
build_mono=1
127-
publish_nuget=0
128-
publish_maven=0
12997

130-
while getopts "h?v:t:b:p:n-:" opt; do
98+
while getopts "h?v:t:b:n-:" opt; do
13199
case "$opt" in
132100
h|\?)
133101
echo "Usage: $0 [OPTIONS...]"
134102
echo
135103
echo " -v godot version (e.g: 3.2-stable) [mandatory]"
136104
echo " -t templates version (e.g. 3.2.stable) [mandatory]"
137105
echo " -b build target: all|classical|mono|none (default: all)"
138-
echo " -p publish target: all|nuget|maven|none (default: none)"
139106
echo " --no-cleanup disable deleting pre-existing output folders (default: false)"
140107
echo " --no-tarball disable generating source tarball (default: false)"
141108
echo
@@ -157,16 +124,6 @@ while getopts "h?v:t:b:p:n-:" opt; do
157124
build_mono=0
158125
fi
159126
;;
160-
p)
161-
if [ "$OPTARG" == "nuget" ]; then
162-
publish_nuget=1
163-
elif [ "$OPTARG" == "maven" ]; then
164-
publish_maven=1
165-
elif [ "$OPTARG" == "all" ]; then
166-
publish_nuget=1
167-
publish_maven=1
168-
fi
169-
;;
170127
-)
171128
case "${OPTARG}" in
172129
no-cleanup)
@@ -579,22 +536,4 @@ if [ "${build_mono}" == "1" ]; then
579536

580537
fi
581538

582-
# NuGet packages
583-
584-
if [ "${publish_nuget}" == "1" ]; then
585-
586-
echo "Publishing NuGet packages..."
587-
publish_nuget_packages out/linux/x86_64/tools-mono/GodotSharp/Tools/nupkgs/*.nupkg
588-
589-
fi
590-
591-
# Godot Android library
592-
593-
if [ "${publish_maven}" == "1" ]; then
594-
595-
echo "Publishing Android library to MavenCentral..."
596-
publish_maven_library
597-
598-
fi
599-
600539
echo "All editor binaries and templates prepared successfully for release"

config.sh.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
# relevant tool in your PATH or an absolute path to run it from.
1313
export PODMAN='podman'
1414

15+
# Path to a Git clone of https://github.com/godotengine/godot-builds.
16+
# Only used for uploading official releases.
17+
export GODOT_BUILDS_PATH=''
18+
19+
# SSH hostname to upload Web editor builds to.
20+
# Only used for uploading official releases.
21+
export WEB_EDITOR_HOSTNAME=''
22+
1523
# Registry for build containers.
1624
# The default registry is the one used for official Godot builds.
1725
# Note that some of its images are private and only accessible to selected

publish-release.sh

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Config
6+
7+
# For signing keys, and path to godot-builds repo.
8+
source ./config.sh
9+
10+
godot_version=""
11+
web_editor_latest=0
12+
13+
while getopts "h?v:l" opt; do
14+
case "$opt" in
15+
h|\?)
16+
echo "Usage: $0 [OPTIONS...]"
17+
echo
18+
echo " -v godot version (e.g: 3.2-stable) [mandatory]"
19+
echo " -l mark web editor as latest"
20+
echo
21+
exit 1
22+
;;
23+
v)
24+
godot_version=$OPTARG
25+
;;
26+
l)
27+
web_editor_latest=1
28+
;;
29+
esac
30+
done
31+
32+
if [ -z "${godot_version}" ]; then
33+
echo "Mandatory argument -v missing."
34+
exit 1
35+
fi
36+
37+
# Confirm
38+
39+
IFS=- read version status <<< "${godot_version}"
40+
echo "Publishing Godot ${version} ${status}."
41+
read -p "Is this correct (y/n)? " choice
42+
case "$choice" in
43+
y|Y ) echo "yes";;
44+
n|N ) echo "No, aborting."; exit 0;;
45+
* ) echo "Invalid choice, aborting."; exit 1;;
46+
esac
47+
template_version=${version}.${status}
48+
49+
# Upload to GitHub godot-builds
50+
51+
if [ -z "${GODOT_BUILDS_PATH}" ]; then
52+
echo "Missing path to godotengine/godot-builds clone in config.sh, necessary to upload releases. Aborting."
53+
exit 1
54+
fi
55+
56+
${GODOT_BUILDS_PATH}/tools/upload-github.sh -v ${version} -f ${status}
57+
58+
# Web editor
59+
60+
scp -P 22 -r web/${template_version} ${WEB_EDITOR_HOSTNAME}:/home/akien/web_editor/
61+
sleep 2
62+
command="sudo mv /home/akien/web_editor/${template_version} /var/www/editor.godotengine.org/public/releases/"
63+
command="${command}; cd /var/www/editor.godotengine.org; sudo chown -R www-data:www-data public/releases/${template_version}"
64+
command="${command}; sudo ./create-symlinks.sh -v ${template_version}"
65+
if [ $web_editor_latest == 1 ]; then
66+
command="${command} -l"
67+
fi
68+
ssh -P 22 ${WEB_EDITOR_HOSTNAME} "${command}"
69+
70+
# NuGet packages
71+
72+
publish_nuget_packages() {
73+
for pkg in "$@"; do
74+
dotnet nuget push $pkg --source "${NUGET_SOURCE}" --api-key "${NUGET_API_KEY}" --skip-duplicate
75+
done
76+
}
77+
78+
if [ ! -z "${NUGET_SOURCE}" ] && [ ! -z "${NUGET_API_KEY}" ] && [[ $(type -P "dotnet") ]]; then
79+
echo "Publishing NuGet packages..."
80+
publish_nuget_packages out/linux/x86_64/tools-mono/GodotSharp/Tools/nupkgs/*.nupkg
81+
else
82+
echo "Disabling NuGet package publishing as config.sh does not define the required data (NUGET_SOURCE, NUGET_API_KEY), or dotnet can't be found in PATH."
83+
fi
84+
85+
# Godot Android library
86+
87+
if [ -d "deps/keystore" ]; then
88+
echo "Publishing Android library to MavenCentral..."
89+
sh build-android/upload-mavencentral.sh
90+
else
91+
echo "Disabling Android library publishing as deps/keystore doesn't exist."
92+
fi
93+
94+
# Stable release only
95+
96+
if [ "${status}" == "stable" ]; then
97+
echo "NOTE: This script doesn't handle yet uploading stable releases to the main GitHub repository, Steam, EGS, and itch.io."
98+
fi

0 commit comments

Comments
 (0)