Skip to content

Commit

Permalink
sync with upstream/5.58.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bradrf committed Sep 8, 2022
1 parent 73023fe commit 633a243
Show file tree
Hide file tree
Showing 43 changed files with 2,188 additions and 98 deletions.
14 changes: 14 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.224.3/containers/typescript-node/.devcontainer/base.Dockerfile

# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 16, 14, 12, 16-bullseye, 14-bullseye, 12-bullseye, 16-buster, 14-buster, 12-buster
ARG VARIANT="16-bullseye"
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends git-lfs

ARG EXTRA_NODE_VERSION=16.15.0
RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"

# [Optional] Uncomment if you want to install more global node packages
# RUN su node -c "npm install -g <your-package-list -here>"
47 changes: 47 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Setup

* vscode will start container capable of builds
* following normal instructions in ../CONTRIBUTING.md
* asdf plugin add nodejs
* asdf install nodejs 16.13.2
* asdf global nodejs 16.13.2
* copy config/production.json settings into development.json
* yarn start

REMEMBER: You can use the NODE_APP_INSTANCE env var to point to different local config files!
* the runtime uses the profile name as a way to look up the associated config
* e.g. "alice" loads "local-alice.json" and uses ~/.config/Signal.alice as the runtime config directory

## Registering Standalone

* following CONTRIBUTING.md section
* to avoid opening real signal app when solving captcha, open devtools and copy the "signalcaptcha://signal-recaptcha-v2.6..." URL and pass it along to the dev version
* node_modules/.bin/electron . "signalcaptcha://signal-recaptcha-v2.6..."

## building macos

* install xcode (and command line tools)
* yarn build will not work over ssh!!
* needs access to running display, etc. for something
* just dev'ing w/ yarn generate && yarn build:webpack work fine, tho

## building windows

* install [nvm-windows](https://github.com/coreybutler/nvm-windows)
* nvm install 16.13.2
* do NOT install build tools per contributing docs! they install an old python
* install python3
* install visual studio
* be sure to include C++ build support!
* setting envvar for pointing to config: `$env:NODE_APP_INSTANCE = 'win10'`

## signing

* this will generate a keypair (public/private.key files in root): `node ts/updater/generateKeyPair.js`
* **REMEMBER!!!!** the *public* key needs to be placed in the config/production.json
* **ALSO!!!!** the signatures embed the version in them, so if you try generating a fake upgrade you must temporarily change the package.json version
* or other configs, if running locally
* this will sign the built release: `yarn run sign-release`
* only the exe and zips are signed (since dmgs have their own built-in signatures)
* to force signing of dmgs (in the case where they aren't signed themselves, signal will expect a sig file):
* `for f in release/*.dmg; do node ts/updater/generateSignature.js -u $f; done`
35 changes: 35 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.224.3/containers/typescript-node
{
"name": "Node.js & TypeScript",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a Node version: 16, 14, 12.
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local on arm64/Apple Silicon.
"args": {
"VARIANT": "16-bullseye"
}
},

// Set *default* container specific settings.json values on container create.
"settings": {},


// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"dbaeumer.vscode-eslint",
"redhat.vscode-yaml",
"esbenp.prettier-vscode",
"foxundermoon.shell-format"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node"
}
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ components/**
coverage/**
dist/**
release/**
deploy/scripts/*

# Github workflows
.github/**
Expand Down
4 changes: 0 additions & 4 deletions .github/FUNDING.yml

This file was deleted.

49 changes: 39 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# Copyright 2020-2022 Signal Messenger, LLC
# SPDX-License-Identifier: AGPL-3.0-only

name: CI
on:
push:
branches:
- development
- main
- '[0-9]+.[0-9]+.x'
pull_request:
paths-ignore:
- deploy/wrangler.toml
- deploy/src/**
workflow_dispatch:

jobs:
lint:
Expand Down Expand Up @@ -40,11 +38,17 @@ jobs:
# - run: yarn lint-license-comments
- run: git diff --exit-code

- uses: sarisia/actions-status-discord@v1
if: ${{ always() && !success() }}
with:
webhook: ${{ secrets.DISCORD_ACTION_URL }}
title: ${{ github.workflow }} lint

macos:
needs: lint
runs-on: macos-latest
if: github.ref == 'refs/heads/development' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
timeout-minutes: 30
runs-on: macos-11
if: ${{ github.repository == '3numdao/Signal.web3-Desktop' }}
timeout-minutes: 45

steps:
- run: uname -a
Expand Down Expand Up @@ -78,6 +82,12 @@ jobs:
env:
NODE_ENV: production

- uses: sarisia/actions-status-discord@v1
if: always()
with:
webhook: ${{ secrets.DISCORD_ACTION_URL }}
title: ${{ runner.os }} ${{ github.workflow }}

linux:
needs: lint
runs-on: ubuntu-latest
Expand Down Expand Up @@ -118,10 +128,17 @@ jobs:
env:
NODE_ENV: production

- uses: sarisia/actions-status-discord@v1
if: always()
with:
webhook: ${{ secrets.DISCORD_ACTION_URL }}
title: ${{ runner.os }} ${{ github.workflow }}

windows:
needs: lint
runs-on: windows-latest
timeout-minutes: 30
if: ${{ github.repository == '3numdao/Signal.web3-Desktop' }}

steps:
- run: systeminfo
Expand Down Expand Up @@ -158,10 +175,16 @@ jobs:
env:
SIGNAL_ENV: production

- uses: sarisia/actions-status-discord@v1
if: always()
with:
webhook: ${{ secrets.DISCORD_ACTION_URL }}
title: ${{ runner.os }} ${{ github.workflow }}

mock-tests:
needs: lint
runs-on: ubuntu-latest
if: ${{ github.repository == 'signalapp/Signal-Desktop-Private' }}
if: ${{ false }} # ${{ github.repository == '3numdao/Signal-Desktop-private' }}
timeout-minutes: 30

steps:
Expand Down Expand Up @@ -215,3 +238,9 @@ jobs:
with:
name: logs
path: artifacts

- uses: sarisia/actions-status-discord@v1
if: always()
with:
webhook: ${{ secrets.DISCORD_ACTION_URL }}
title: ${{ github.workflow }} mock-tests
157 changes: 157 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
name: Release
on:
push:
tags:
- "v*.*.*-enum.*"

jobs:
create:
runs-on: ubuntu-latest
steps:
- id: release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: false
- uses: sarisia/actions-status-discord@v1
if: ${{ always() && !success() }}
with:
webhook: ${{ secrets.DISCORD_ACTION_URL }}
title: ${{ github.workflow }} create

build:
needs: create

strategy:
fail-fast: false # let others run to completion
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
release_suffix: ubuntu
- os: macos-latest
release_suffix: mac
- os: windows-latest
release_suffix: windows

runs-on: ${{ matrix.os }}
timeout-minutes: 60

steps:
- name: Install Apple certificates
if: matrix.os == 'macos-latest'
env:
APP_CERT_BASE64: ${{ secrets.APP_CERT_BASE64 }}
INSTALL_CERT_BASE64: ${{ secrets.INSTALL_CERT_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
# create variables
APP_CERT_PATH=$RUNNER_TEMP/app_cert.p12
INSTALL_CERT_PATH=$RUNNER_TEMP/install_cert.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$APP_CERT_BASE64" | base64 --decode --output $APP_CERT_PATH
echo -n "$INSTALL_CERT_BASE64" | base64 --decode --output $INSTALL_CERT_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $APP_CERT_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security import $INSTALL_CERT_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
- name: Prepare Windows checkout
if: matrix.os == 'windows-latest'
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.15.0'
- run: npm install -g yarn@1.22.10

- name: Cache Desktop node_modules
id: cache-desktop-modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
- name: Install Desktop node_modules
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile

- run: yarn generate
env:
TELEMETRY_API_KEY: ${{ secrets.TELEMETRY_API_KEY }}
- run: yarn prepare-beta-build

- name: Run yarn build (non-windows)
run: yarn build
if: matrix.os != 'windows-latest'
env:
DISABLE_INSPECT_FUSE: on
APPLE_USERNAME: ${{ secrets.APPLE_USERNAME }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}

- name: Run yarn build (windows)
if: matrix.os == 'windows-latest'
env:
DISABLE_INSPECT_FUSE: on
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
run: yarn build

- run: yarn sign-release
env:
UPDATES_PRIVATE_KEY: ${{ secrets.UPDATES_PRIVATE_KEY }}

- name: Upload binaries for deployment
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
cd deploy
yarn install
yarn upload
- uses: actions/upload-artifact@v3
with:
name: manifests
path: release/latest*.yml

- uses: softprops/action-gh-release@v1
with:
files: |
release/*.dmg
release/*.deb
release/*.exe
- name: Clean up keychain and provisioning profile
if: ${{ always() && matrix.os == 'macos-latest' }}
run: security delete-keychain $RUNNER_TEMP/app-signing.keychain-db

- uses: sarisia/actions-status-discord@v1
if: ${{ always() && !success() }}
with:
webhook: ${{ secrets.DISCORD_ACTION_URL }}
title: ${{ runner.os }} ${{ github.workflow }} build

announce:
needs: build
runs-on: ubuntu-latest
steps:
- id: release
uses: softprops/action-gh-release@v1

- uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_WEBHOOK_URL }}
nodetail: true
title: Released ${{ steps.release.outputs.url }}
Loading

0 comments on commit 633a243

Please sign in to comment.