mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-13 02:38:15 +01:00
46 lines
2.1 KiB
YAML
46 lines
2.1 KiB
YAML
name: "[Release] suite message system config"
|
|
|
|
permissions:
|
|
id-token: write # for fetching the OIDC token
|
|
contents: read # for actions/checkout
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
release-config:
|
|
if: ${{ github.repository == 'trezor/trezor-suite' && (github.ref == 'refs/heads/release-message-system-production' || github.ref == 'refs/heads/release-message-system-develop') }}
|
|
environment: ${{ github.ref == 'refs/heads/release-message-system-production' && 'production-message' || 'develop-message' }}
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
RELEASE_ENV: ${{ github.ref == 'refs/heads/release-message-system-production' && 'production' || 'develop' }}
|
|
AWS_REGION: "eu-central-1"
|
|
AWS_CLOUDFRONT_ID: E1ERY5K2OTKKI1
|
|
ROLE_TO_ASSUME: ${{ github.ref == 'refs/heads/release-message-system-production' && 'arn:aws:iam::538326561891:role/gh_actions_suite_production_message' || 'arn:aws:iam::538326561891:role/gh_actions_suite_develop_message' }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Configure aws credentials
|
|
uses: aws-actions/configure-aws-credentials@v4
|
|
with:
|
|
role-to-assume: ${{ env.ROLE_TO_ASSUME }}
|
|
aws-region: ${{ env.AWS_REGION }}
|
|
|
|
- name: Build and sign ${{ env.RELEASE_ENV }} message-system config file
|
|
env:
|
|
IS_CODESIGN_BUILD: ${{ env.RELEASE_ENV == 'production' && 'true' || 'false' }}
|
|
JWS_PRIVATE_KEY_ENV: ${{ secrets.JWS_PRIVATE_KEY_ENV }}
|
|
run: |
|
|
yarn install
|
|
yarn message-system-sign-config
|
|
|
|
- name: Upload ${{ env.RELEASE_ENV }} message-system config file
|
|
run: |
|
|
aws s3 cp suite-common/message-system/files/config.v1.jws s3://data.trezor.io/config/${{ env.RELEASE_ENV == 'production' && 'stable' || 'develop'}}/config.v1.jws --cache-control no-cache
|
|
aws cloudfront create-invalidation --distribution-id ${AWS_CLOUDFRONT_ID} --paths '/config/${{ env.RELEASE_ENV == 'production' && 'stable' || 'develop'}}/*'
|