Update all non-major dependencies
[ProtonMail-WebClient.git] / applications / pass-desktop / tools / deploy-metadata.sh
blobe7ae1ad853705e42f901bd071b21910ba1ba0729
1 #!/usr/bin/env sh
2 set -euo
4 if [ -z "${PASS_DESKTOP_METADATA_REPO}" ]; then
5 echo "PASS_DESKTOP_METADATA_REPO is not set."
6 exit 1
7 fi
9 PLATFORM="$PASS_RELEASE_PLATFORM"
10 CHANNEL="$PASS_RELEASE_CHANNEL"
11 VERSION=$(grep '"version":' -m 1 applications/pass-desktop/package.json | sed 's/.*"version": "\(.*\)".*/\1/')
12 CWD=$(pwd)
13 GIT_COMMIT_AUTHOR="${GITLAB_USER_NAME}"
14 GIT_COMMIT_EMAIL="${GITLAB_USER_EMAIL}"
15 METADATA_REPO=$(mktemp -d)
16 BRANCH_NAME="release/${PLATFORM}-${VERSION}-${CHANNEL}"
18 # Clone existing metadata
19 git clone --depth 1 "${PASS_DESKTOP_METADATA_REPO}" "$METADATA_REPO"
21 # Configure git
22 cd "$METADATA_REPO"
23 git config --local user.name "${GIT_COMMIT_AUTHOR}"
24 git config --local user.email "${GIT_COMMIT_EMAIL}"
26 # Update metadata
27 python3 "${CWD}/applications/pass-desktop/tools/update-metadata.py" "$PLATFORM" "$CHANNEL"
29 # Copy over RELEASES
30 if [ "$PLATFORM" = "windows" ]; then
31 cp "$CWD/applications/pass-desktop/out/make/squirrel.windows/x64/RELEASES" "assets/windows/RELEASES"
32 elif [ "$PLATFORM" = "macos" ]; then
33 cp "$CWD/applications/pass-desktop/out/make/zip/darwin/universal/RELEASES.json" "assets/macos/RELEASES.json"
36 # Deploy metadata
37 git checkout -b "$BRANCH_NAME"
38 git add .
39 git status
40 git commit -m "Pass Desktop ${VERSION} (${PLATFORM}, ${CHANNEL})"
41 git push -u origin "$BRANCH_NAME" -o merge_request.create -o merge_request.target=main -o merge_request.remove_source_branch