chore(suite-native): delete always falsy condition #15
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
# TODO: add tests and call it [Build/Test] | |
name: "[Build] connect" | |
permissions: | |
id-token: write # for fetching the OIDC token | |
contents: read # for actions/checkout | |
on: | |
pull_request: | |
paths: | |
- "packages/blockchain-link" | |
- "packages/connect/**" | |
- "packages/connect-common/**" | |
- "packages/connect-iframe/**" | |
- "packages/connect-web/**" | |
- "packages/transport" | |
- "packages/utxo-lib" | |
- "packages/utils" | |
- "submodules/trezor-common" | |
- "yarn.lock" | |
env: | |
DEV_SERVER_HOSTNAME: "dev.suite.sldev.cz" | |
jobs: | |
build-connect-explorer: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Configure aws credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws:iam::538326561891:role/gh_actions_trezor_suite_dev_deploy | |
aws-region: eu-central-1 | |
- name: Extract branch name | |
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | |
id: extract_branch | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
- name: Build connect-web | |
run: | | |
git submodule update --init --recursive | |
yarn install --immutable | |
yarn build:libs | |
yarn workspace @trezor/connect-web build | |
./packages/connect-web/scripts/check-inline-build-size.sh | |
yarn workspace @trezor/connect-iframe build | |
yarn workspace @trezor/connect-popup build | |
yarn workspace @trezor/connect-webextension build | |
- name: Build connect-explorer | |
env: | |
ASSET_PREFIX: /connect/${{ steps.extract_branch.outputs.branch }} | |
# TODO: maybe we don't want to build it for production for every branch | |
NODE_ENV: "production" | |
url: https://${ DEV_SERVER_HOSTNAME }/connect/${{ steps.extract_branch.outputs.branch }} | |
run: | | |
yarn workspace @trezor/connect-explorer build | |
- name: Build connect-examples webextension | |
run: | | |
node ./packages/connect-examples/update-webextensions.js --trezor-connect-src "https://${ DEV_SERVER_HOSTNAME }/connect/${{ steps.extract_branch.outputs.branch }}/" | |
node ./packages/connect-examples/update-webextensions.js --trezor-connect-src "https://${ DEV_SERVER_HOSTNAME }/connect/${{ steps.extract_branch.outputs.branch }}/" --build-folder build-legacy --npm-src "https://connect.trezor.io/9/trezor-connect.js" | |
node ./packages/connect-examples/update-webextensions-sw.js | |
- name: Build connect-explorer-webextension | |
run: | | |
yarn workspace @trezor/connect-explorer build:webextension | |
# this step should upload build result to s3 bucket DEV_SERVER_HOSTNAME using awscli | |
- name: Upload connect-explorer to dev.suite.sldev.cz | |
env: | |
DEPLOY_PATH: s3://${ DEV_SERVER_HOSTNAME }/connect/${{ steps.extract_branch.outputs.branch }} | |
run: | | |
mkdir -p tmp_build_directory | |
cp -R ./packages/connect-iframe/build/* tmp_build_directory/ | |
cp -R ./packages/connect-popup/build/* tmp_build_directory/ | |
cp -R ./packages/connect-web/build/* tmp_build_directory/ | |
cp -R ./packages/connect-explorer/build/* tmp_build_directory/ | |
aws s3 sync --delete tmp_build_directory/ ${DEPLOY_PATH} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-artifacts | |
path: | | |
packages/connect-examples/webextension-mv2/build | |
packages/connect-examples/webextension-mv2/build-legacy | |
packages/connect-examples/webextension-mv3/build | |
packages/connect-examples/webextension-mv3/build-legacy | |
packages/connect-examples/webextension-mv3-sw/build | |
packages/connect-explorer/build-webextension |