Skip to content

Commit

Permalink
Create a different latest nightly symlink for each branch
Browse files Browse the repository at this point in the history
Affects nightly builds uploaded to the OSUOSL server. Currently we
create a single 'latest' symlink on each platform, e.g. on macOS:

    MuseScoreNightly-latest-x86_64.dmg

Now we will create one for each branch:

    MuseScoreNightly-latest-master-x86_64.dmg
    MuseScoreNightly-latest-4.0.2-x86_64.dmg

This helps to avoid confusion, and also avoids the race condition where
the 'latest' symlink sometimes points to a master nightly and sometimes
to a 4.0.2 nightly depending on the time of day.

On Linux, for similar reasons, a separate zsync automatic updates file
will be created for each branch.

The current "branchless" symlink and zync files will remain unmodified
on the server until they are eventually deleted by the same code that
is used to delete old nightly files on each upload.
  • Loading branch information
shoogle committed Apr 4, 2023
1 parent 22861e5 commit 8582f3a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build/ci/linux/package.sh
Expand Up @@ -82,7 +82,7 @@ if [ "$PACKTYPE" == "appimage" ]; then
# https://github.com/AppImage/AppImageSpec/blob/master/draft.md#update-information
case "${BUILD_MODE}" in
"stable_build") export UPDATE_INFORMATION="gh-releases-zsync|musescore|MuseScore|latest|MuseScore-*x86_64.AppImage.zsync";;
"nightly_build") export UPDATE_INFORMATION="zsync|https://ftp.osuosl.org/pub/musescore-nightlies/linux/${MAJOR_VERSION}x/nightly/MuseScoreNightly-latest-x86_64.AppImage.zsync";;
"nightly_build") export UPDATE_INFORMATION="zsync|https://ftp.osuosl.org/pub/musescore-nightlies/linux/${MAJOR_VERSION}x/nightly/MuseScoreNightly-latest-${BUILD_BRANCH}-x86_64.AppImage.zsync";;
*) unset UPDATE_INFORMATION;; # disable updates for other build modes
esac

Expand Down
7 changes: 5 additions & 2 deletions build/ci/tools/osuosl/publish.sh
Expand Up @@ -76,8 +76,11 @@ chmod 600 $SSH_KEY

FTP_PATH=${OS}/${MAJOR_VERSION}x/${BUILD_DIR}

file_extension="${ARTIFACT_NAME##*.}"
LATEST_NAME="MuseScoreNightly-latest-x86_64.${file_extension}"
if [ "$BUILD_MODE" == "nightly_build" ]; then
file_extension="${ARTIFACT_NAME##*.}"
BUILD_BRANCH=$(cat $ARTIFACTS_DIR/env/build_branch.env)
LATEST_NAME="MuseScoreNightly-latest-${BUILD_BRANCH}-x86_64.${file_extension}"
fi

echo "Copy ${ARTIFACTS_DIR}/${ARTIFACT_NAME} to $FTP_PATH"
scp -oStrictHostKeyChecking=no -C -i $SSH_KEY $ARTIFACTS_DIR/$ARTIFACT_NAME musescore-nightlies@ftp-osl.osuosl.org:~/ftp/$FTP_PATH
Expand Down

0 comments on commit 8582f3a

Please sign in to comment.