From 29a99d4c75acdb3fbee9431da5564a14d1af09f2 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Mon, 23 Sep 2024 18:05:40 +1000 Subject: [PATCH] chore: cleanup package.json --- .github/workflows/build-binaries.yml | 1 - actions/build_no_publish/action.yml | 6 +++--- actions/build_publish/action.yml | 8 +++++--- build/updateLocalConfig.js | 2 +- package.json | 19 +++++-------------- yarn.lock | 22 ---------------------- 6 files changed, 14 insertions(+), 44 deletions(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 8087cdd068..9f75fafbbc 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -28,7 +28,6 @@ jobs: # macos-14 is disabled for now as we hit our free tier limit for macos builds os: [windows-2022, ubuntu-20.04, macos-12] env: - SIGNAL_ENV: production GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - run: git config --global core.autocrlf false diff --git a/actions/build_no_publish/action.yml b/actions/build_no_publish/action.yml index fc2c23c832..73f93282ac 100644 --- a/actions/build_no_publish/action.yml +++ b/actions/build_no_publish/action.yml @@ -23,14 +23,14 @@ runs: - name: Build windows production binaries shell: bash if: runner.os == 'Windows' - run: $(yarn bin)/electron-builder --config.extraMetadata.environment=%SIGNAL_ENV% --publish=never --config.directories.output=release + run: yarn build-release - name: Build mac production binaries shell: bash if: runner.os == 'macOS' run: | source ./build/setup-mac-certificate.sh - $(yarn bin)/electron-builder --config.extraMetadata.environment=$SIGNAL_ENV --config.mac.bundleVersion=${{ github.ref }} --publish=never --config.directories.output=release + yarn build-release --config.mac.bundleVersion=${{ github.ref }} env: MAC_CERTIFICATE: ${{ inputs.MAC_CERTIFICATE }} MAC_CERTIFICATE_PASSWORD: ${{ inputs.MAC_CERTIFICATE_PASSWORD }} @@ -43,7 +43,7 @@ runs: if: runner.os == 'Linux' run: | sudo apt-get install -y rpm - yarn build-release + yarn sedtoDeb; yarn build-release && yarn sedtoAppImage && yarn build-release && yarn sedtoDeb - name: Remove unpacked files run: | diff --git a/actions/build_publish/action.yml b/actions/build_publish/action.yml index 607d1bedc4..6ae1d83921 100644 --- a/actions/build_publish/action.yml +++ b/actions/build_publish/action.yml @@ -1,19 +1,21 @@ name: 'Build & Publish' description: 'Build & Publish' + runs: using: 'composite' + steps: - name: Build & publish windows production binaries shell: bash if: runner.os == 'Windows' && github.ref == 'master' && github.event_name == 'push' - run: $(yarn bin)/electron-builder --config.extraMetadata.environment=%SIGNAL_ENV% --publish=always + run: $(yarn bin)/electron-builder --config.extraMetadata.environment=production --publish=always - name: Build & publish mac production binaries shell: bash if: runner.os == 'macOS' && github.ref == 'master' && github.event_name == 'push' run: | source ./build/setup-mac-certificate.sh - $(yarn bin)/electron-builder --config.extraMetadata.environment=$SIGNAL_ENV --config.mac.bundleVersion=${{ github.ref }} --publish=always + $(yarn bin)/electron-builder --config.extraMetadata.environment=production --config.mac.bundleVersion=${{ github.ref }} --publish=always env: MAC_CERTIFICATE: ${{ secrets.MAC_CERTIFICATE }} MAC_CERTIFICATE_PASSWORD: ${{ secrets.MAC_CERTIFICATE_PASSWORD }} @@ -26,4 +28,4 @@ runs: if: runner.os == 'Linux' && github.ref == 'master' && github.event_name == 'push' run: | sudo apt-get install -y rpm - yarn build-release-publish + yarn sedtoDeb; yarn build-release-publish && yarn sedtoAppImage && yarn build-release-publish && yarn sedtoDeb diff --git a/build/updateLocalConfig.js b/build/updateLocalConfig.js index 7fbbe4df1e..3691a54cf0 100644 --- a/build/updateLocalConfig.js +++ b/build/updateLocalConfig.js @@ -3,7 +3,7 @@ var _ = require('lodash'); var execSync = require('child_process').execSync; const updateLocalConfig = () => { - var environment = process.env.SIGNAL_ENV || 'production'; + var environment = 'production'; var configPath = `config/local-${environment}.json`; var localConfig; diff --git a/package.json b/package.json index eb923bb2fa..af46c1c7c9 100644 --- a/package.json +++ b/package.json @@ -49,17 +49,9 @@ "format-full": "prettier --list-different --write \"*.{css,js,json,scss,ts,tsx}\" \"./**/*.{css,js,json,scss,ts,tsx}\"", "start-prod-test": "cross-env NODE_ENV=production NODE_APP_INSTANCE=$MULTI electron .", "test": "mocha", - "build-release": "run-script-os", - "build-release-non-linux": "yarn build-everything && cross-env SIGNAL_ENV=production electron-builder --config.extraMetadata.environment=production --publish=never --config.directories.output=release", - "build-release:win32": "yarn build-release-non-linux", - "build-release:macos": "yarn build-release-non-linux", - "build-release:linux": "yarn sedtoDeb; yarn build-release-non-linux && yarn sedtoAppImage && yarn build-release-non-linux && yarn sedtoDeb", - "build-release-publish": "run-script-os", - "build-release-publish-non-linux": "yarn build-everything && cross-env SIGNAL_ENV=production $(yarn bin)/electron-builder --config.extraMetadata.environment=$SIGNAL_ENV --publish=always", - "build-release-publish:win32": "yarn build-release-publish-non-linux", - "build-release-publish:macos": "yarn build-release-publish-non-linux", - "build-release-publish:linux": "yarn sedtoDeb; yarn build-release-publish-non-linux && yarn sedtoAppImage && yarn build-release-publish-non-linux && yarn sedtoDeb", - "appImage": "yarn sedtoAppImage; yarn build-release-non-linux; yarn sedtoDeb", + "build-release-base": "cross-env NODE_ENV=production electron-builder --config.extraMetadata.environment=production", + "build-release": "yarn build-release-base --publish=never --config.directories.output=release", + "build-release-publish": "yarn build-release-base --publish=always", "sedtoAppImage": "sed -i 's/\"target\": \\[\"deb\", \"rpm\", \"freebsd\"\\]/\"target\": \"AppImage\"/g' package.json", "sedtoDeb": "sed -i 's/\"target\": \"AppImage\"/\"target\": \\[\"deb\", \"rpm\", \"freebsd\"\\]/g' package.json", "ready": "yarn dedup-yarn-lock --fail && yarn build-everything && yarn lint-full && yarn test", @@ -207,7 +199,6 @@ "postinstall-prepare": "^1.0.1", "prettier": "3.2.5", "protobufjs-cli": "^1.1.1", - "run-script-os": "^1.1.6", "sass": "^1.60.0", "sass-loader": "^13.2.2", "sinon": "9.0.2", @@ -294,8 +285,8 @@ "files": [ "package.json", "config/default.json", - "config/${env.SIGNAL_ENV}.json", - "config/local-${env.SIGNAL_ENV}.json", + "config/${env.production}.json", + "config/local-${env.production}.json", "background.html", "about.html", "password.html", diff --git a/yarn.lock b/yarn.lock index 28c77acd2a..ea585cedce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -765,13 +765,6 @@ resolved "https://registry.yarnpkg.com/@types/filesize/-/filesize-3.6.0.tgz#5f1a25c7b4e3d5ee2bc63133d374d096b7008c8d" integrity sha512-rOWxCKMjt2DBuwddUnl5GOpf/jAkkqteB+XldncpVxVX+HPTmK2c5ACMOVEbp9gaH81IlhTdC3TwvRa5nopasw== -"@types/firstline@^2.0.2": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@types/firstline/-/firstline-2.0.4.tgz#b8d3f8f7396d1589efea89db183c047a42efaf04" - integrity sha512-EYoMzk783ncj3soLGADXD/rklDMw1PAO5Hc3lRZa5G21vkfacwkdTlIdhTJ39omqDLezTSmxjDG1psd4A/mUHg== - dependencies: - "@types/node" "*" - "@types/fs-extra@5.0.5": version "5.0.5" resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-5.0.5.tgz#080d90a792f3fa2c5559eb44bd8ef840aae9104b" @@ -3674,11 +3667,6 @@ find-yarn-workspace-root@^2.0.0: dependencies: micromatch "^4.0.2" -firstline@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/firstline/-/firstline-1.2.1.tgz#b88673c42009f8821fac2926e99720acee924fae" - integrity sha512-6eMQNJtDzyXSC1yeCBWspqA6LeV5la2XHGTXQq4O0xkglAutpyny/sB+zVdXTZ9nzcDW9ZGLxwXXkB+ZEtJuPw== - flat-cache@^3.0.4: version "3.2.0" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee" @@ -6381,11 +6369,6 @@ read-config-file@6.2.0: json5 "^2.2.0" lazy-val "^1.0.4" -read-last-lines-ts@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/read-last-lines-ts/-/read-last-lines-ts-1.2.1.tgz#99e46288c5373c06e16e90e666a46b595dad80a1" - integrity sha512-1VcCrAU38DILYiF4sbNY13zdrMGwrFqjGQnXJy28G1zLJItvnWtgCbqoAJlnZZSiEICMKdM4Ol7LYvVMEoKrAg== - read-pkg-up@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" @@ -6695,11 +6678,6 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -run-script-os@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/run-script-os/-/run-script-os-1.1.6.tgz#8b0177fb1b54c99a670f95c7fdc54f18b9c72347" - integrity sha512-ql6P2LzhBTTDfzKts+Qo4H94VUKpxKDFz6QxxwaUZN0mwvi7L3lpOI7BqPCq7lgDh3XLl0dpeXwfcVIitlrYrw== - safe-array-concat@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.1.2.tgz#81d77ee0c4e8b863635227c721278dd524c20edb"