From fd23e3043d23178de3d07a48129a4870335e50cd Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Wed, 3 Apr 2024 14:59:22 +0200 Subject: [PATCH] ci: upload emulator binaries to data.trezor.io [skip_ci] --- .github/workflows/core.yml | 23 ++++++++++++++++++++++- .github/workflows/legacy.yml | 28 +++++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index dd7072e1f..282d32732 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -120,11 +120,12 @@ jobs: - run: nix-shell --run "poetry run make -C core build_bootloader_emu" if: matrix.coins == 'universal' && matrix.model != 'T3T1' # FIXME T3T1 bootloader emulator - run: nix-shell --run "poetry run make -C core build_unix_frozen" + - run: cp core/build/unix/trezor-emu-core core/build/unix/trezor-emu-core-${{ matrix.model }}-${{ matrix.coins }} - uses: actions/upload-artifact@v4 with: name: core-emu-${{ matrix.model }}-${{ matrix.coins }}-${{ matrix.type }}-${{ matrix.asan }} path: | - core/build/unix/trezor-emu-core + core/build/unix/trezor-emu-core* core/build/bootloader_emu/bootloader.elf retention-days: 7 @@ -707,5 +708,25 @@ jobs: - uses: ./.github/actions/ui-comment if: ${{ steps.check-fixtures-changed.outputs.FIXTURES_CHANGED == '1' }} + core_upload_emu: + name: Upload emulator binaries + if: github.event_name == 'schedule' + runs-on: ubuntu-latest + needs: core_emu + steps: + - uses: actions/download-artifact@v4 + with: + pattern: core-emu*debuglink-noasan + merge-multiple: true + - name: Configure aws credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::538326561891:role/gh_actions_deploy_dev_firmware_data + aws-region: eu-west-1 + continue-on-error: true + - run: | + rm unix/trezor-emu-core + aws s3 sync unix s3://data.trezor.io/dev/firmware/emu-nightly + # Connect # TODO: core_connect_test diff --git a/.github/workflows/legacy.yml b/.github/workflows/legacy.yml index 34bf8c9bf..d3eb4e98d 100644 --- a/.github/workflows/legacy.yml +++ b/.github/workflows/legacy.yml @@ -3,6 +3,8 @@ name: Legacy on: pull_request: workflow_dispatch: + schedule: + - cron: '35 22 * * *' # every day @ 22:35 permissions: id-token: write # for fetching the OIDC token @@ -63,10 +65,13 @@ jobs: submodules: recursive - uses: ./.github/actions/environment - run: nix-shell --run "poetry run legacy/script/cibuild" + - run: cp legacy/firmware/trezor.elf legacy/firmware/trezor-emu-legacy-T1B1-${{ matrix.coins }} - uses: actions/upload-artifact@v4 with: name: legacy-emu-${{ matrix.coins }}-${{ matrix.type }}-${{ matrix.asan }} - path: legacy/firmware/*.elf + path: | + legacy/firmware/*.elf + legacy/firmware/trezor-emu-legacy* retention-days: 7 legacy_device_test: @@ -195,3 +200,24 @@ jobs: id: check-fixtures-changed - uses: ./.github/actions/ui-comment if: ${{ steps.check-fixtures-changed.outputs.FIXTURES_CHANGED == '1' }} + + core_upload_emu: + name: Upload emulator binaries + if: github.event_name == 'schedule' + runs-on: ubuntu-latest + needs: legacy_emu + steps: + - uses: actions/download-artifact@v4 + with: + pattern: legacy-emu*debuglink-noasan + merge-multiple: true + - name: Configure aws credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::538326561891:role/gh_actions_deploy_dev_firmware_data + aws-region: eu-west-1 + continue-on-error: true + - run: | + mkdir emulators + cp trezor-emu-legacy* emulators + aws s3 sync emulators s3://data.trezor.io/dev/firmware/emu-nightly