Verified Commit 48420e15 authored by ma1's avatar ma1
Browse files

MB 466: Automate the release process / replace the new build email

parent b77d601e
Loading
Loading
Loading
Loading
+1 −30
Changes for .gitlab/issue_templates/Release Prep - Mullvad Browser Alpha.md: 1 added line, 30 removed lines.
Original line number Diff line number Diff line
@@ -168,6 +168,7 @@ Mullvad Browser Alpha (and Nightly) are on the `main` branch
    ```

### mullvad-browser (GitHub): https://github.com/mullvad/mullvad-browser/
This step will send the relevant branches, tags (including a tag named after the release version, e.g. `16.0a1`) and the signed build for QA to Mullvad's github repository.
- [ ] Assign this issue to someone with mullvad commit access, one of:
    - boklm
    - ma1
@@ -177,40 +178,10 @@ Mullvad Browser Alpha (and Nightly) are on the `main` branch
    ```bash
    cd tor-browser-build/tools/signing/ && ./publish-github.mullvadbrowser
    ```

</details>

<details>
  <summary>Communications</summary>

### Mullvad
- [ ] Email Mullvad with release information:
  - **Recipients**
    - Mullvad support alias: support@mullvadvpn.net
    - Rui Hildt: rui@mullvad.net
    ```
    support@mullvadvpn.net, rui@mullvad.net,
    ```
  - **Subject**
    ```
    New build: Mullvad Browser ${MULLVAD_BROWSER_VERSION} (signed)
    ```
  - **Body**
    ```
    Hello,

    Branch+Tags have been pushed to Mullvad's GitHub repo.

    - signed builds: https://dist.torproject.org/mullvadbrowser/${MULLVAD_BROWSER_VERSION}
    - update_response hashes: ${MULLVAD_UPDATE_RESPONSES_HASH}

    * https://gitlab.torproject.org/tpo/applications/mullvad-browser-update-responses

    changelog:
    # paste changelog as quote here
    ...
    ```

### packagers
- [ ] **(Optional, Once Packages are pushed to GitHub)**
  - **NOTE**: This is an optional step and only necessary close a major release/transition from alpha to stable, or if there are major packing changes these developers need to be aware of
+5 −30
Changes for .gitlab/issue_templates/Release Prep - Mullvad Browser Stable.md: 5 added lines, 30 removed lines.
Original line number Diff line number Diff line
@@ -171,6 +171,7 @@ Mullvad Browser Stable is on the `maint-${MULLVAD_BROWSER_MAJOR}.${MULLVAD_BROWS
    ```

### mullvad-browser (GitHub): https://github.com/mullvad/mullvad-browser/
This step will send the relevant branches, tags (including a tag named after the release version, e.g. `15.0`) and the signed build for QA to Mullvad's github repository.
- [ ] Assign this issue to someone with mullvad commit access, one of:
    - boklm
    - ma1
@@ -180,40 +181,14 @@ Mullvad Browser Stable is on the `maint-${MULLVAD_BROWSER_MAJOR}.${MULLVAD_BROWS
    ```bash
    cd tor-browser-build/tools/signing/ && ./publish-github.mullvadbrowser
    ```

  - **NOTE**: if you need the release version tag to be suffixed someway, e.g. because it's a release candidate (`15.0rc1` instead of `15.0`), just add the fix as the first argument of the script:
     ```bash
     ./publish-github.mullvadbrowser rc1
     ```
</details>

<details>
  <summary>Communications</summary>

### Mullvad
- [ ] Email Mullvad with release information:
  - **Recipients**
    - Mullvad support alias: support@mullvadvpn.net
    - Rui Hildt: rui@mullvad.net
    ```
    support@mullvadvpn.net, rui@mullvad.net
    ```
  - **Subject**
    ```
    New build: Mullvad Browser ${MULLVAD_BROWSER_VERSION} (signed)
    ```
  - **Body**
    ```
    Hello,

    Branch+Tags have been pushed to Mullvad's GitHub repo.

    - signed builds: https://dist.torproject.org/mullvadbrowser/${MULLVAD_BROWSER_VERSION}
    - update_response hashes: ${MULLVAD_UPDATE_RESPONSES_HASH}*

    * https://gitlab.torproject.org/tpo/applications/mullvad-browser-update-responses

    changelog:
    # paste changelog as quote here
    ...
    ```

### packagers
- [ ] **(Once Packages are pushed to GitHub)**
  - **Recipients**
+34 −2
Changes for tools/signing/publish-github.mullvadbrowser: 34 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -4,6 +4,17 @@ TBB_DIR="$SCRIPT_DIR/../.."
function showconf {
   "$TBB_DIR/rbm/rbm" showconf $@
}

# we may want to add a suffix to the release tag, e.g. rc1
mbrtag_suffix="$1"
github_token=$(showconf release buildconf/devmole_auth_token2 2>/dev/null)
if ! [[ $github_token ]]; then
  echo >&2 "Github token (buildconf/devmole_auth_token) missing!"
  exit 1
fi

set -e

GL_REMOTE=git@gitlab.torproject.org:tpo/applications/mullvad-browser.git
GH_REMOTE=git@github.com:mullvad/mullvad-browser.git
CLONE_DIR="$TBB_DIR/git_clones/firefox"
@@ -13,17 +24,19 @@ MB_TAG=$(showconf firefox git_hash $TARGET)
MB_BRANCH=${MB_TAG//-build[0-9]*/}
BB_BRANCH=${MB_BRANCH//mullvad-/base-}
ESR_VERSION=$(showconf firefox var/firefox_version $TARGET)
RELEASE_VERSION=$(showconf release var/torbrowser_version $TARGET)
BASE_VERSION=$(showconf release var/torbrowser_version $TARGET)
RELEASE_VERSION="${BASE_VERSION}${mbrtag_suffix}"
pushd >/dev/null ../../git_clones/firefox
echo "Fetching $MB_BRANCH and tags..."
git fetch --tags "$GL_REMOTE" "$MB_BRANCH"
BB_TAG=$(git tag -l "$BB_BRANCH-build*" | tail -n1)
FX_TAG=$(git tag -l "FIREFOX_${ESR_VERSION//\./_}*" | tail -n1)
echo "QA build version: $BASE_VERSION"
echo "MB tag: $MB_TAG"
echo "BB tag: $BB_TAG"
echo "FX tag: $FX_TAG"
echo "Mullvad release tag: $RELEASE_VERSION"
read -p "Do you want to tag mullvad $RELEASE_VERSION and push everything to ${GH_REMOTE}? (y/N) " -n 1 -r
read -p "Do you want to tag mullvad $RELEASE_VERSION and push tags/branches/QA build to ${GH_REMOTE}? (y/N) " -n 1 -r
echo
if ! [[ $REPLY =~ ^[Yy]$ ]]; then
   echo >&2 "Operation cancelled"
@@ -37,3 +50,22 @@ git push "$GH_REMOTE" "$FX_TAG"
git push "$GH_REMOTE" "$BB_TAG"
git push "$GH_REMOTE" "$RELEASE_VERSION"
popd >/dev/null

# Call Mullvad's github workflow for new releases (mullvad-browser#466)

version=$BASE_VERSION
response=$(curl -L \
  -X POST \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer $github_token" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  "https://api.github.com/repos/mullvad/mullvad-browser/actions/workflows/new_browser_release.yml/dispatches" \
  -d "{\"ref\":\"main\",\"inputs\":{\"version\":\"$version\"}}")

if ! [ $response ]; then
  echo "Build $BASE_VERSION submitted."
else
  echo >&2 "Something went wrong with build submission:"
  echo >&2 $response
  exit 3
fi