-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
2,188 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ components/** | |
coverage/** | ||
dist/** | ||
release/** | ||
deploy/scripts/* | ||
|
||
# Github workflows | ||
.github/** | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
Oops, something went wrong.