ma1 pushed to branch main at The Tor Project / Applications / tor-browser-build


Commits:
15ee5d47 by hackademix at 2025-02-26T19:31:28+01:00
Bug 41381: More flexible tagging script.

- - - - -


2 changed files:

- tools/browser/README.md
- tools/browser/sign-tag


Changes:

=====================================
tools/browser/README.md
=====================================
@@ -37,11 +37,11 @@ This script gpg signs a git tag associated with a 
particular browser commit in t
 
 #### Prerequisites
 
-- The user must create the following soft-links:
+- The user may create the following soft-links (by default they are 
automatically pointed to ../../git_clones/firefox):
     - `/tools/browser/basebrowser` -> `/path/to/local/tor-browser.git`
     - `/tools/browser/mullvadbrowser` -> `/path/to/local/mullvad-browser.git`
     - `/tools/browser/torbrowser` -> `/path/to/local/tor-browser.git`
-- The user must first checkout the relevant branch of the commit we are tagging
+- The user must first checkout the relevant branch (local or remote-tracking) 
of the commit we are tagging
     - This is needed to extract the ESR version, branch-number, and browser 
name
 
 #### Usage
@@ -93,4 +93,4 @@ Invoke the relevant soft-link'd version of this script to 
sign a particular brow
     Tag commit 385aa0559a90 in mullvad-browser-128.4.0esr-14.0-1
      tag:     mullvad-browser-128.4.0esr-14.0-1-build2
      message: Tagging build2 for 128.4.0esr-based stable
-    ```
\ No newline at end of file
+    ```


=====================================
tools/browser/sign-tag
=====================================
@@ -18,7 +18,9 @@ browser=$(echo "$script_name" | perl -pe 's/^[^\.]+\.//')
 case "${browser}" in
     basebrowser | torbrowser | mullvadbrowser)
         # go down to browser directory
-        pushd ${script_dir}/${browser} > /dev/null
+        browser_dir="$script_dir/$browser"
+        [ -e "$browser_dir" ] || ln -s "../../git_clones/firefox" 
"$browser_dir"
+        pushd "$browser_dir" > /dev/null
         # and exit on script termination
         trap "popd > /dev/null" EXIT
         ;;
@@ -33,7 +35,7 @@ esac
 # and message
 #
 
-branch_name=$(git rev-parse --abbrev-ref HEAD)
+branch_name=$(git log -n1 --oneline --decorate=short | grep -Eo 
'[a-z]+-browser-[1-9][0-9]+[^),]*-[1-9]' | head -n1)
 if [[ $branch_name =~ 
^([a-z]+-browser)-([1-9][0-9]+\.[0-9]+)(\.[0-9]+esr|a[1-9][0-9]*)-([1-9][0-9]*\.[05])-([1-9]).*$
 ]]; then
     project="${BASH_REMATCH[1]}"
     upstream="${BASH_REMATCH[2]}${BASH_REMATCH[3]}"
@@ -77,8 +79,10 @@ commit=$(git rev-parse --short ${3:-HEAD})
 
 # channel validation
 if [[ "${project}" == "mullvad-browser" ]]; then
+    repo="$project"
     valid_channels=("rapid" "alpha" "stable")
 else
+    repo="tor-browser"
     valid_channels=("rapid" "alpha" "stable" "legacy")
 fi
 channel_valid=false
@@ -113,3 +117,9 @@ echo " tag:     ${tag}"
 echo " message: ${message}"
 
 git tag -s "${tag}" "${commit}" -m "${message}"
+
+read -p "Do you want to push ${tag} to ${repo}.git? (y/N) " -n 1 -r
+echo
+if [[ $REPLY =~ ^[Yy]$ ]]; then
+    git push "[email protected]:tpo/applications/${repo}.git" "${tag}"
+fi



View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/15ee5d4764592345c87ed6df7cce2cf256abb4ae

-- 
View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/15ee5d4764592345c87ed6df7cce2cf256abb4ae
You're receiving this email because of your account on gitlab.torproject.org.


_______________________________________________
tbb-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to