Skip to content

[Release] suite definitions #71

[Release] suite definitions

[Release] suite definitions #71

name: "[Release] suite definitions"
permissions:
id-token: write # for fetching the OIDC token
contents: read # for actions/checkout
on:
workflow_dispatch:
inputs:
environment:
description: "Release definitions environment"
type: choice
options:
- develop-definitions
- production-definitions
required: true
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
release-suite-definitions:
environment: ${{ github.event.inputs.environment }}
runs-on: ubuntu-latest
env:
AWS_REGION: "eu-central-1"
AWS_CLOUDFRONT_ID: E1ERY5K2OTKKI1
COINGECKO_API_KEY: ${{ secrets.COINGECKO_API_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ github.event.inputs.environment == 'develop-definitions' && 'arn:aws:iam::538326561891:role/gh_actions_suite_develop_definitions' || 'arn:aws:iam::538326561891:role/gh_actions_suite_production_definitions' }}
aws-region: ${{ env.AWS_REGION }}
- name: Build and sign ${{ github.event.inputs.environment }} token-definitions
if: ${{ github.event.inputs.environment == 'develop-definitions' && github.ref == 'refs/heads/develop' }}
run: |
yarn install
cd suite-common/token-definitions
yarn nfts simple ethereum jws
yarn nfts simple polygon-pos jws
yarn nfts simple binance-smart-chain jws
yarn nfts simple optimistic-ethereum jws
yarn coins simple ethereum jws
yarn coins simple ethereum-classic jws
yarn coins simple polygon-pos jws
yarn coins simple binance-smart-chain jws
yarn coins simple optimistic-ethereum jws
yarn coins simple cardano jws
yarn coins simple solana jws
yarn coins advanced solana json
- name: Build and sign ${{ github.event.inputs.environment }} token-definitions files
if: ${{ github.event.inputs.environment == 'production-definitions' && github.ref == 'refs/heads/develop' }}
env:
IS_CODESIGN_BUILD: "true"
JWS_PRIVATE_KEY_ENV: ${{ secrets.JWS_PRIVATE_KEY_ENV }}
run: |
yarn install
cd suite-common/token-definitions
yarn nfts simple ethereum jws
yarn nfts simple polygon-pos jws
yarn nfts simple binance-smart-chain jws
yarn nfts simple optimistic-ethereum jws
yarn coins simple ethereum jws
yarn coins simple ethereum-classic jws
yarn coins simple polygon-pos jws
yarn coins simple binance-smart-chain jws
yarn coins simple optimistic-ethereum jws
yarn coins simple cardano jws
yarn coins simple solana jws
yarn coins advanced solana json
- name: Upload ${{ github.event.inputs.environment }} token-definitions files
if: ${{ github.ref == 'refs/heads/develop' }}
run: |
if [ '${{ github.event.inputs.environment }}' == 'production-definitions' ]
then
aws s3 sync --delete suite-common/token-definitions/files/ s3://data.trezor.io/suite/definitions/stable/ --cache-control no-cache
aws cloudfront create-invalidation --distribution-id ${AWS_CLOUDFRONT_ID} --paths '/suite/definitions/stable/*'
else
aws s3 sync --delete suite-common/token-definitions/files/ s3://data.trezor.io/suite/definitions/develop/ --cache-control no-cache
aws cloudfront create-invalidation --distribution-id ${AWS_CLOUDFRONT_ID} --paths '/suite/definitions/develop/*'
fi