diff --git a/.github/workflows/actions/build-upload-mithril-artifact/action.yml b/.github/workflows/actions/build-upload-mithril-artifact/action.yml index 6d37f63d81f..8858e1de413 100644 --- a/.github/workflows/actions/build-upload-mithril-artifact/action.yml +++ b/.github/workflows/actions/build-upload-mithril-artifact/action.yml @@ -17,7 +17,7 @@ runs: id: label shell: bash run: echo "short_sha=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT - + - name: Add commit short sha to Cargo.tomls version shell: ${{ runner.os == 'Windows' && 'pwsh' || 'bash' }} run: | @@ -34,7 +34,7 @@ runs: run: cargo build --lib --release ${{ inputs.libraries-build-args }} ${{ inputs.common-build-args }} - name: Publish Mithril Distribution (${{ runner.os }}-${{ runner.arch }}) - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: mithril-distribution-${{ runner.os }}-${{ runner.arch }} path: | diff --git a/.github/workflows/actions/deploy-terraform-infrastructure/action.yml b/.github/workflows/actions/deploy-terraform-infrastructure/action.yml index 9c6c02beef9..504e60df2b6 100644 --- a/.github/workflows/actions/deploy-terraform-infrastructure/action.yml +++ b/.github/workflows/actions/deploy-terraform-infrastructure/action.yml @@ -58,23 +58,23 @@ inputs: mithril_signers: description: Mithril signers settings. required: true - mithril_genesis_secret_key: + mithril_genesis_secret_key: description: Mithril genesis secret key (only for test networks). required: false - mithril_genesis_verification_key_url: + mithril_genesis_verification_key_url: description: Mithril genesis verification key location. required: true mithril_era_reader_adapter_type: description: Mithril era reader adapter type. required: false default: "cardano-chain" - mithril_era_reader_address_url: + mithril_era_reader_address_url: description: Mithril era reader address location. required: true - mithril_era_reader_verification_key_url: + mithril_era_reader_verification_key_url: description: Mithril era reader verification key url. required: true - mithril_era_reader_secret_key: + mithril_era_reader_secret_key: description: Mithril era reader secret key (onlye for test networks). required: false mithril_aggregator_signed_entity_types: @@ -88,143 +88,143 @@ inputs: description: Mithril aggregator CNAME field used for the snapshot CDN. required: false default: "false" - mithril_aggregator_snapshot_compression_algorithm: + mithril_aggregator_snapshot_compression_algorithm: description: Mithril aggregator snapshot compression algorithm. required: false - mithril_aggregator_zstandard_parameters_level: + mithril_aggregator_zstandard_parameters_level: description: Mithril aggregator snapshot zstandard compression level. required: false - mithril_aggregator_zstandard_parameters_workers: + mithril_aggregator_zstandard_parameters_workers: description: Mithril aggregator snapshot zstandard number of workers. required: false mithril_aggregator_cexplorer_pools_url: description: CExplorer url of the list of pools that is used by the mithril aggregator. required: false - prometheus_auth_username: + prometheus_auth_username: description: Prometheus metrics endpoint username. required: false - prometheus_auth_password: + prometheus_auth_password: description: Prometheus metrics endpoint password. required: false - prometheus_ingest_host: + prometheus_ingest_host: description: Prometheus ingester endpoint location. required: false - prometheus_ingest_username: + prometheus_ingest_username: description: Prometheus ingester endpoint username. required: false - prometheus_ingest_password: + prometheus_ingest_password: description: Prometheus ingester endpoint password. required: false - loki_auth_username: + loki_auth_username: description: Loki metrics endpoint username. required: false - loki_auth_password: + loki_auth_password: description: Loki metrics endpoint password. required: false - loki_ingest_host: + loki_ingest_host: description: Loki ingester endpoint location. required: false - loki_ingest_username: + loki_ingest_username: description: Loki ingester endpoint username. required: false - loki_ingest_password: + loki_ingest_password: description: Loki ingester endpoint password. required: false runs: using: "composite" steps: - - name: Checkout sources - uses: actions/checkout@v3 + - name: Checkout sources + uses: actions/checkout@v4 - - name: Prepare service account credentials - shell: bash - working-directory: mithril-infra - run: | - echo '${{ inputs.google_application_credentials}}' > ./google-application-credentials.json - chmod u+x ./assets/tools/utils/google-credentials-public-key.sh - ./assets/tools/utils/google-credentials-public-key.sh ./google-application-credentials.json ./assets/ssh_keys curry + - name: Prepare service account credentials + shell: bash + working-directory: mithril-infra + run: | + echo '${{ inputs.google_application_credentials}}' > ./google-application-credentials.json + chmod u+x ./assets/tools/utils/google-credentials-public-key.sh + ./assets/tools/utils/google-credentials-public-key.sh ./google-application-credentials.json ./assets/ssh_keys curry - - name: Prepare terraform variables - shell: bash - working-directory: mithril-infra - run: | - cat > ./env.variables.tfvars << EOF - environment_prefix = "${{ inputs.environment_prefix }}" - cardano_network = "${{ inputs.cardano_network }}" - cardano_image_id = "${{ inputs.cardano_node_version }}" - cardano_image_registry = "${{ inputs.cardano_node_docker_registry }}" - google_region = "${{ inputs.google_region }}" - google_zone = "${{ inputs.google_zone }}" - google_machine_type = "${{ inputs.google_machine_type }}" - google_compute_instance_boot_disk_size = "${{ inputs.google_compute_instance_boot_disk_size }}" - google_compute_instance_data_disk_size = "${{ inputs.google_compute_instance_data_disk_size }}" - google_service_credentials_json_file = "./google-application-credentials.json" - mithril_use_p2p_network = "${{ inputs.mithril_use_p2p_network }}" - mithril_api_domain = "${{ inputs.mithril_api_domain }}" - mithril_image_id = "${{ inputs.mithril_image_id }}" - mithril_genesis_verification_key_url = "${{ inputs.mithril_genesis_verification_key_url }}" - mithril_genesis_secret_key = "${{ inputs.mithril_genesis_secret_key }}" - mithril_protocol_parameters = ${{ fromJSON(inputs.mithril_protocol_parameters) }} - mithril_signers = ${{ fromJSON(inputs.mithril_signers) }} - mithril_era_reader_adapter_type = "${{ inputs.mithril_era_reader_adapter_type }}" - mithril_era_reader_address_url = "${{ inputs.mithril_era_reader_address_url }}" - mithril_era_reader_verification_key_url = "${{ inputs.mithril_era_reader_verification_key_url }}" - mithril_era_reader_secret_key = "${{ inputs.mithril_era_reader_secret_key }}" - mithril_aggregator_signed_entity_types = "${{ inputs.mithril_aggregator_signed_entity_types }}" - mithril_aggregator_cdn_cname = "${{ inputs.mithril_aggregator_cdn_cname }}" - mithril_aggregator_snapshot_use_cdn_domain = ${{ inputs.mithril_aggregator_snapshot_use_cdn_domain }} - mithril_aggregator_snapshot_compression_algorithm = "${{ inputs.mithril_aggregator_snapshot_compression_algorithm }}" - mithril_aggregator_zstandard_parameters_level = "${{ inputs.mithril_aggregator_zstandard_parameters_level }}" - mithril_aggregator_zstandard_parameters_workers = "${{ inputs.mithril_aggregator_zstandard_parameters_workers }}" - mithril_aggregator_cexplorer_pools_url = "${{ inputs.mithril_aggregator_cexplorer_pools_url }}" - prometheus_auth_username = "${{ inputs.prometheus_auth_username }}" - prometheus_auth_password = "${{ inputs.prometheus_auth_password }}" - prometheus_ingest_host = "${{ inputs.prometheus_ingest_host }}" - prometheus_ingest_username = "${{ inputs.prometheus_ingest_username }}" - prometheus_ingest_password = "${{ inputs.prometheus_ingest_password }}" - loki_auth_username = "${{ inputs.loki_auth_username }}" - loki_auth_password = "${{ inputs.loki_auth_password }}" - loki_ingest_host = "${{ inputs.loki_ingest_host }}" - loki_ingest_username = "${{ inputs.loki_ingest_username }}" - loki_ingest_password = "${{ inputs.loki_ingest_password }}" - EOF - terraform fmt ./env.variables.tfvars - cat ./env.variables.tfvars + - name: Prepare terraform variables + shell: bash + working-directory: mithril-infra + run: | + cat > ./env.variables.tfvars << EOF + environment_prefix = "${{ inputs.environment_prefix }}" + cardano_network = "${{ inputs.cardano_network }}" + cardano_image_id = "${{ inputs.cardano_node_version }}" + cardano_image_registry = "${{ inputs.cardano_node_docker_registry }}" + google_region = "${{ inputs.google_region }}" + google_zone = "${{ inputs.google_zone }}" + google_machine_type = "${{ inputs.google_machine_type }}" + google_compute_instance_boot_disk_size = "${{ inputs.google_compute_instance_boot_disk_size }}" + google_compute_instance_data_disk_size = "${{ inputs.google_compute_instance_data_disk_size }}" + google_service_credentials_json_file = "./google-application-credentials.json" + mithril_use_p2p_network = "${{ inputs.mithril_use_p2p_network }}" + mithril_api_domain = "${{ inputs.mithril_api_domain }}" + mithril_image_id = "${{ inputs.mithril_image_id }}" + mithril_genesis_verification_key_url = "${{ inputs.mithril_genesis_verification_key_url }}" + mithril_genesis_secret_key = "${{ inputs.mithril_genesis_secret_key }}" + mithril_protocol_parameters = ${{ fromJSON(inputs.mithril_protocol_parameters) }} + mithril_signers = ${{ fromJSON(inputs.mithril_signers) }} + mithril_era_reader_adapter_type = "${{ inputs.mithril_era_reader_adapter_type }}" + mithril_era_reader_address_url = "${{ inputs.mithril_era_reader_address_url }}" + mithril_era_reader_verification_key_url = "${{ inputs.mithril_era_reader_verification_key_url }}" + mithril_era_reader_secret_key = "${{ inputs.mithril_era_reader_secret_key }}" + mithril_aggregator_signed_entity_types = "${{ inputs.mithril_aggregator_signed_entity_types }}" + mithril_aggregator_cdn_cname = "${{ inputs.mithril_aggregator_cdn_cname }}" + mithril_aggregator_snapshot_use_cdn_domain = ${{ inputs.mithril_aggregator_snapshot_use_cdn_domain }} + mithril_aggregator_snapshot_compression_algorithm = "${{ inputs.mithril_aggregator_snapshot_compression_algorithm }}" + mithril_aggregator_zstandard_parameters_level = "${{ inputs.mithril_aggregator_zstandard_parameters_level }}" + mithril_aggregator_zstandard_parameters_workers = "${{ inputs.mithril_aggregator_zstandard_parameters_workers }}" + mithril_aggregator_cexplorer_pools_url = "${{ inputs.mithril_aggregator_cexplorer_pools_url }}" + prometheus_auth_username = "${{ inputs.prometheus_auth_username }}" + prometheus_auth_password = "${{ inputs.prometheus_auth_password }}" + prometheus_ingest_host = "${{ inputs.prometheus_ingest_host }}" + prometheus_ingest_username = "${{ inputs.prometheus_ingest_username }}" + prometheus_ingest_password = "${{ inputs.prometheus_ingest_password }}" + loki_auth_username = "${{ inputs.loki_auth_username }}" + loki_auth_password = "${{ inputs.loki_auth_password }}" + loki_ingest_host = "${{ inputs.loki_ingest_host }}" + loki_ingest_username = "${{ inputs.loki_ingest_username }}" + loki_ingest_password = "${{ inputs.loki_ingest_password }}" + EOF + terraform fmt ./env.variables.tfvars + cat ./env.variables.tfvars - - name: Setup Terraform - uses: hashicorp/setup-terraform@v2 - with: - terraform_wrapper: false + - name: Setup Terraform + uses: hashicorp/setup-terraform@v3 + with: + terraform_wrapper: false - - name: Init Terraform - shell: bash - working-directory: mithril-infra - run: | - GOOGLE_APPLICATION_CREDENTIALS=./google-application-credentials.json terraform init -backend-config="bucket=${{ inputs.terraform_backend_bucket }}" -backend-config="prefix=terraform/mithril-${{ inputs.environment }}" -upgrade + - name: Init Terraform + shell: bash + working-directory: mithril-infra + run: | + GOOGLE_APPLICATION_CREDENTIALS=./google-application-credentials.json terraform init -backend-config="bucket=${{ inputs.terraform_backend_bucket }}" -backend-config="prefix=terraform/mithril-${{ inputs.environment }}" -upgrade - - name: Check Terraform - shell: bash - working-directory: mithril-infra - run: terraform fmt -check + - name: Check Terraform + shell: bash + working-directory: mithril-infra + run: terraform fmt -check - - name: Terraform Plan - if: inputs.dry_run == 'true' - shell: bash - working-directory: mithril-infra - run: | - GOOGLE_APPLICATION_CREDENTIALS=./google-application-credentials.json terraform plan --var-file=./env.variables.tfvars + - name: Terraform Plan + if: inputs.dry_run == 'true' + shell: bash + working-directory: mithril-infra + run: | + GOOGLE_APPLICATION_CREDENTIALS=./google-application-credentials.json terraform plan --var-file=./env.variables.tfvars - - name: Terraform Apply - shell: bash - working-directory: mithril-infra - if: inputs.dry_run == 'false' - run: | - GOOGLE_APPLICATION_CREDENTIALS=./google-application-credentials.json terraform apply -auto-approve --var-file=./env.variables.tfvars + - name: Terraform Apply + shell: bash + working-directory: mithril-infra + if: inputs.dry_run == 'false' + run: | + GOOGLE_APPLICATION_CREDENTIALS=./google-application-credentials.json terraform apply -auto-approve --var-file=./env.variables.tfvars - - name: Cleanup - shell: bash - working-directory: mithril-infra - run: | - rm -f ./env.variables.tfvars - rm -f ./google-application-credentials.json + - name: Cleanup + shell: bash + working-directory: mithril-infra + run: | + rm -f ./env.variables.tfvars + rm -f ./google-application-credentials.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42b323a6112..ce9ad33439b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,7 @@ on: - 'main' - 'hotfix**' pull_request: - types: [opened, reopened, synchronize] + types: [ opened, reopened, synchronize ] branches-ignore: - 'hotfix**' # hotfix are handled by the push trigger @@ -21,7 +21,7 @@ jobs: eras: ${{ steps.eras-test-lab.outputs.eras }} steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install stable toolchain, tools, and restore cache uses: ./.github/workflows/actions/toolchain-and-cache @@ -33,10 +33,7 @@ jobs: - name: Cargo build - Tooling shell: bash run: | - cargo build --features portable --release --workspace \ - --exclude mithril-aggregator --exclude mithril-client-cli \ - --exclude mithril-client --exclude mithril-signer \ - --exclude mithril-stm + cargo build --features portable --release -p mithril-end-to-end - name: Build Mithril workspace & publish artifacts uses: ./.github/workflows/actions/build-upload-mithril-artifact @@ -53,14 +50,14 @@ jobs: cargo deb --no-build --package mithril-relay - name: Publish Debian packages - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: mithril-deb-packages-${{ runner.os }}-${{ runner.arch }} path: target/debian/*.deb if-no-files-found: error - name: Publish End-to-end runner (${{ runner.os }}-${{ runner.arch }}) - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: mithril-end-to-end-${{ runner.os }}-${{ runner.arch }} path: target/release/mithril-end-to-end @@ -80,20 +77,20 @@ jobs: os: [ macos-12, windows-latest ] include: - # Only build client on windows & mac - - os: macos-12 - binaries-build-args: --bin mithril-client --features bundle_openssl - libraries-build-args: --package mithril-stm --package mithril-client --features full,unstable - - os: windows-latest - # Use `--bins --package ` instead of `--bin `, otherwise the 'windows' compatibility - # hack in mithril common cargo.toml doesn't apply (we have no idea why). - binaries-build-args: --bins --package mithril-client-cli --features bundle_openssl - libraries-build-args: --package mithril-stm --package mithril-client --no-default-features --features num-integer-backend,full,unstable + # Only build client on windows & mac + - os: macos-12 + binaries-build-args: --bin mithril-client --features bundle_openssl + libraries-build-args: --package mithril-stm --package mithril-client --features full,unstable + - os: windows-latest + # Use `--bins --package ` instead of `--bin `, otherwise the 'windows' compatibility + # hack in mithril common cargo.toml doesn't apply (we have no idea why). + binaries-build-args: --bins --package mithril-client-cli --features bundle_openssl + libraries-build-args: --package mithril-stm --package mithril-client --no-default-features --features num-integer-backend,full,unstable runs-on: ${{ matrix.os }} steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install stable toolchain and restore cache uses: ./.github/workflows/actions/toolchain-and-cache @@ -111,7 +108,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install stable toolchain, tools, and restore cache uses: ./.github/workflows/actions/toolchain-and-cache @@ -155,7 +152,7 @@ jobs: wasm-pack test --node mithril-client-wasm --release - name: Publish Mithril Distribution (WASM) - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: mithril-distribution-wasm path: | @@ -180,7 +177,7 @@ jobs: steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install stable toolchain, tools, and restore cache uses: ./.github/workflows/actions/toolchain-and-cache @@ -207,7 +204,7 @@ jobs: mv target/nextest/ci/tests-result.junit.xml test-results${{ matrix.artifact-suffix }}-${{ runner.os }}-${{ runner.arch }}.xml - name: Upload Tests Results - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: success() || failure() with: name: test-results${{ matrix.artifact-suffix }}-${{ runner.os }}-${{ runner.arch }} @@ -218,7 +215,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install stable toolchain, tools, and restore cache uses: ./.github/workflows/actions/toolchain-and-cache @@ -240,7 +237,7 @@ jobs: - name: Upload clippy analysis results to GitHub if: success() || failure() - uses: github/codeql-action/upload-sarif@v2 + uses: github/codeql-action/upload-sarif@v3 with: sarif_file: rust-clippy-results.sarif wait-for-processing: true @@ -257,7 +254,7 @@ jobs: - name: Dependency & Vulnerabilities Review if: github.event_name == 'pull_request' - uses: actions/dependency-review-action@v3 + uses: actions/dependency-review-action@v4 with: base-ref: ${{ github.event.pull_request.base.sha || 'main' }} head-ref: ${{ github.event.pull_request.head.sha || github.ref }} @@ -268,12 +265,12 @@ jobs: strategy: fail-fast: false matrix: - mode: ["std"] + mode: [ "std" ] era: ${{ fromJSON(needs.build-ubuntu-X64.outputs.eras) }} - cardano_node_version: ["8.7.3"] - hard_fork_latest_era_at_epoch: [0,10,100] - run_id: ["#1","#2"] - extra_args: [""] + cardano_node_version: [ "8.7.3" ] + hard_fork_latest_era_at_epoch: [ 0,10,100 ] + run_id: [ "#1","#2" ] + extra_args: [ "" ] include: # Include a hard fork test for `8.1.2` which is not concerned @@ -292,16 +289,16 @@ jobs: extra_args: "--use-p2p-network" steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Download binaries - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: mithril-distribution-${{ runner.os }}-${{ runner.arch }} path: ./bin - name: Download rust test runner - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: mithril-end-to-end-${{ runner.os }}-${{ runner.arch }} path: ./ @@ -325,8 +322,8 @@ jobs: --cardano-hard-fork-latest-era-at-epoch ${{ matrix.hard_fork_latest_era_at_epoch }} ${{ matrix.extra_args }} - name: Upload E2E Tests Artifacts - if: ${{ failure() }} - uses: actions/upload-artifact@v3 + if: ${{ failure() }} + uses: actions/upload-artifact@v4 with: name: mithril-e2e-tests-artifacts-run_${{ github.run_number }}-attempt_${{ github.run_attempt }}-mode_${{ matrix.mode }}-era_${{ matrix.era }}-cardano-${{ matrix.cardano_node_version }}-fork-${{ matrix.hard_fork_latest_era_at_epoch }}-run_id_${{ matrix.run_id }} path: | @@ -341,24 +338,24 @@ jobs: publish-tests-results: if: success() || failure() runs-on: ubuntu-22.04 - needs: + needs: - test steps: - name: Download Tests Results (${{ runner.os }}-${{ runner.arch }}) if: success() || failure() - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: test-results-${{ runner.os }}-${{ runner.arch }} - name: Download Tests Results (macOS-X64) if: success() || failure() - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: test-results-macOS-X64 - name: Download Tests Results (Windows-X64) if: success() || failure() - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: test-results-Windows-X64 @@ -397,10 +394,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Log in to the Container registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -408,7 +405,7 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.PACKAGE }} tags: | @@ -416,13 +413,13 @@ jobs: type=raw,value=${{ github.base_ref || github.ref_name }}-{{sha}} - name: Download built artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: mithril-distribution-${{ runner.os }}-${{ runner.arch }} path: ${{ matrix.project }} - name: Build and push Docker image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: ${{ env.CONTEXT }} file: ${{ env.DOCKER_FILE }} @@ -444,7 +441,7 @@ jobs: - check steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install stable toolchain uses: dtolnay/rust-toolchain@master @@ -475,7 +472,7 @@ jobs: - build-test-wasm steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install stable toolchain, tools, and restore cache uses: ./.github/workflows/actions/toolchain-and-cache @@ -503,7 +500,7 @@ jobs: - check steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Prepare packaging run: mkdir package @@ -513,25 +510,25 @@ jobs: run: echo "sha8=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT - name: Download built artifacts (Linux-X64) - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: mithril-distribution-Linux-X64 path: ./package-Linux-X64 - name: Download Debian packages (Linux-X64) - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: mithril-deb-packages-Linux-X64 path: ./package - name: Download built artifacts (macOS-X64) - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: mithril-distribution-macOS-X64 path: ./package-macOS-X64 - name: Download built artifacts (Windows-X64) - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: mithril-distribution-Windows-X64 path: ./package-Windows-X64 @@ -554,10 +551,10 @@ jobs: files: package/* - name: Update unstable release body with release notes addon - uses: tubone24/update_release@v1.3.1 + uses: tubone24/update_release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TAG_NAME: unstable + TAG_NAME: unstable with: is_append_body: true body_path: ./release-notes-addon.txt @@ -569,62 +566,62 @@ jobs: matrix: environment: [ testing-preview, testing-sanchonet ] include: - - environment: testing-preview - environment_prefix: testing - cardano_network: preview - mithril_use_p2p_network: false - mithril_api_domain: api.mithril.network - mithril_protocol_parameters: | - { - k = 2422 - m = 20973 - phi_f = 0.2 - } - mithril_signers: | - { - "1" = { - type = "verified", - pool_id = "", - }, - "2" = { - type = "verified", - pool_id = "", - }, - "3" = { - type = "verified", - pool_id = "", - }, - } - terraform_backend_bucket: hydra-terraform-admin - google_region: europe-west1 - google_zone: europe-west1-b - google_machine_type: e2-standard-8 - google_compute_instance_boot_disk_size: 200 - google_compute_instance_data_disk_size: 250 - - environment: testing-sanchonet - environment_prefix: testing - cardano_network: sanchonet - mithril_use_p2p_network: false - mithril_api_domain: api.mithril.network - mithril_protocol_parameters: | - { - k = 5 - m = 100 - phi_f = 0.65 - } - mithril_signers: | - { - "1" = { - type = "verified", - pool_id = "", - }, - } - terraform_backend_bucket: hydra-terraform-admin - google_region: europe-west1 - google_zone: europe-west1-b - google_machine_type: e2-highmem-4 - google_compute_instance_boot_disk_size: 200 - google_compute_instance_data_disk_size: 250 + - environment: testing-preview + environment_prefix: testing + cardano_network: preview + mithril_use_p2p_network: false + mithril_api_domain: api.mithril.network + mithril_protocol_parameters: | + { + k = 2422 + m = 20973 + phi_f = 0.2 + } + mithril_signers: | + { + "1" = { + type = "verified", + pool_id = "", + }, + "2" = { + type = "verified", + pool_id = "", + }, + "3" = { + type = "verified", + pool_id = "", + }, + } + terraform_backend_bucket: hydra-terraform-admin + google_region: europe-west1 + google_zone: europe-west1-b + google_machine_type: e2-standard-8 + google_compute_instance_boot_disk_size: 200 + google_compute_instance_data_disk_size: 250 + - environment: testing-sanchonet + environment_prefix: testing + cardano_network: sanchonet + mithril_use_p2p_network: false + mithril_api_domain: api.mithril.network + mithril_protocol_parameters: | + { + k = 5 + m = 100 + phi_f = 0.65 + } + mithril_signers: | + { + "1" = { + type = "verified", + pool_id = "", + }, + } + terraform_backend_bucket: hydra-terraform-admin + google_region: europe-west1 + google_zone: europe-west1-b + google_machine_type: e2-highmem-4 + google_compute_instance_boot_disk_size: 200 + google_compute_instance_data_disk_size: 250 environment: ${{ matrix.environment }} runs-on: ubuntu-22.04 needs: @@ -634,7 +631,7 @@ jobs: working-directory: mithril-infra steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Get Docker image id run: echo "DOCKER_IMAGE_ID=${{ github.base_ref || github.ref_name }}-$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_ENV @@ -689,7 +686,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install stable toolchain and restore cache uses: ./.github/workflows/actions/toolchain-and-cache @@ -720,13 +717,13 @@ jobs: - name: Upload cargo-doc results to GitHub if: success() || failure() - uses: github/codeql-action/upload-sarif@v2 + uses: github/codeql-action/upload-sarif@v3 with: sarif_file: rust-cargo-doc-results.sarif wait-for-processing: true - name: Publish Mithril-rust-doc - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: mithril-rust-doc if-no-files-found: error @@ -737,10 +734,10 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 20 cache: 'npm' @@ -756,7 +753,7 @@ jobs: npm run build - name: Publish Docusaurus build - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: docusaurus-build if-no-files-found: error @@ -768,10 +765,10 @@ jobs: needs: build-test-wasm steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Download built artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: mithril-distribution-wasm path: mithril-client-wasm @@ -782,7 +779,7 @@ jobs: tar -xvzf pkg/*.tgz -C pkg/ && mv pkg/package/* pkg/ - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 20 cache: 'npm' @@ -791,7 +788,7 @@ jobs: - name: Install dependencies working-directory: mithril-explorer run: npm ci - + - name: Test explorer working-directory: mithril-explorer run: make test @@ -805,7 +802,7 @@ jobs: run: make build - name: Publish Explorer build - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: explorer-build if-no-files-found: error @@ -816,7 +813,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build OpenAPI UI uses: Legion2/swagger-ui-action@v1 @@ -825,7 +822,7 @@ jobs: spec-file: ./openapi.yaml - name: Publish OpenAPI UI build - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: openapi-ui-build if-no-files-found: error @@ -842,25 +839,25 @@ jobs: - build-open-api-ui steps: - name: Download mithril-rust-doc artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: mithril-rust-doc path: ./github-pages/rust-doc - name: Download Docusaurus build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: docusaurus-build path: ./github-pages/doc - name: Download Explorer build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: explorer-build path: ./github-pages/explorer - name: Download OpenAPI UI build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: openapi-ui-build path: ./github-pages/openapi-ui diff --git a/.github/workflows/manual-publish-crates.yml b/.github/workflows/manual-publish-crates.yml index 585bdf192ef..fd4123b58b7 100644 --- a/.github/workflows/manual-publish-crates.yml +++ b/.github/workflows/manual-publish-crates.yml @@ -14,10 +14,10 @@ on: required: true type: choice options: - - all - - mithril-stm - - mithril-common - - mithril-client + - all + - mithril-stm + - mithril-common + - mithril-client dry_run: description: Dry run will not publish to crates.io registry. required: true @@ -32,18 +32,18 @@ jobs: matrix: package: [ mithril-stm, mithril-common, mithril-client ] include: - - package: mithril-stm - api_token_secret_name: CRATES_IO_API_TOKEN - - package: mithril-common - api_token_secret_name: CRATES_IO_API_TOKEN_MITHRIL_COMMON - - package: mithril-client - api_token_secret_name: CRATES_IO_API_TOKEN_MITHRIL_CLIENT - + - package: mithril-stm + api_token_secret_name: CRATES_IO_API_TOKEN + - package: mithril-common + api_token_secret_name: CRATES_IO_API_TOKEN_MITHRIL_COMMON + - package: mithril-client + api_token_secret_name: CRATES_IO_API_TOKEN_MITHRIL_CLIENT + runs-on: ubuntu-22.04 steps: - name: Checkout sources if: inputs.package == matrix.package || inputs.package == 'all' - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ inputs.commit_sha }} @@ -52,7 +52,7 @@ jobs: uses: dtolnay/rust-toolchain@master with: toolchain: stable - + - name: ${{ inputs.dry_run && 'Test publish' || 'Publish' }} package to crates.io if: inputs.package == matrix.package || inputs.package == 'all' uses: ./.github/workflows/actions/publish-crate-package diff --git a/.github/workflows/manual-publish-npm.yml b/.github/workflows/manual-publish-npm.yml index a408793eeb6..42d10c94448 100644 --- a/.github/workflows/manual-publish-npm.yml +++ b/.github/workflows/manual-publish-npm.yml @@ -14,16 +14,16 @@ on: required: true type: choice options: - - all - - mithril-client-wasm + - all + - mithril-client-wasm tag: description: | Package(s) tag to be published to npm registry. required: true type: choice options: - - latest - - next + - latest + - next dry_run: description: Dry run will not publish packages to npm registry. required: true @@ -43,12 +43,12 @@ jobs: tag: latest access: public api_token_secret_name: NPM_API_TOKEN_MITHRIL_CLIENT_WASM - + runs-on: ubuntu-22.04 steps: - name: Checkout sources if: inputs.package == matrix.package || inputs.package == 'all' - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ inputs.commit_sha }} @@ -58,7 +58,7 @@ jobs: with: cache-version: ${{ secrets.CACHE_VERSION }}-wasm cargo-tools: wasm-pack - + - name: Publish package to npm if: inputs.package == matrix.package || inputs.package == 'all' uses: ./.github/workflows/actions/publish-npm-package diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 45838763c27..8748c290b64 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -13,13 +13,13 @@ jobs: contents: write steps: - name: Checkout sources - uses: actions/checkout@v3 - + uses: actions/checkout@v4 + - name: Prepare packaging run: mkdir package - name: Download built artifacts (Linux-x64) - uses: dawidd6/action-download-artifact@v2 + uses: dawidd6/action-download-artifact@v3 with: name: mithril-distribution-Linux-X64 path: ./package-Linux-X64 @@ -28,7 +28,7 @@ jobs: workflow_conclusion: success - name: Download Debian packages (Linux-X64) - uses: dawidd6/action-download-artifact@v2 + uses: dawidd6/action-download-artifact@v3 with: name: mithril-deb-packages-Linux-X64 path: ./package @@ -37,16 +37,16 @@ jobs: workflow_conclusion: success - name: Download built artifacts (macOS-x64) - uses: dawidd6/action-download-artifact@v2 + uses: dawidd6/action-download-artifact@v3 with: name: mithril-distribution-macOS-X64 path: ./package-macOS-X64 commit: ${{ github.sha }} workflow: ci.yml workflow_conclusion: success - + - name: Download built artifacts (Windows-x64) - uses: dawidd6/action-download-artifact@v2 + uses: dawidd6/action-download-artifact@v3 with: name: mithril-distribution-Windows-X64 path: ./package-Windows-X64 @@ -76,10 +76,10 @@ jobs: files: package/* - name: Update release body with release notes addon - uses: tubone24/update_release@v1.3.1 + uses: tubone24/update_release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TAG_NAME: ${{ github.ref_name }} + TAG_NAME: ${{ github.ref_name }} with: is_append_body: true body_path: ./release-notes-addon.txt @@ -108,10 +108,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Log in to the Container registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -119,7 +119,7 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.PACKAGE }} tags: | @@ -127,7 +127,7 @@ jobs: type=raw,value=${{ github.ref_name }}-{{sha}} - name: Download built artifacts (Linux-x64) - uses: dawidd6/action-download-artifact@v2 + uses: dawidd6/action-download-artifact@v3 with: name: mithril-distribution-Linux-X64 path: ${{ matrix.project }} @@ -136,7 +136,7 @@ jobs: workflow_conclusion: success - name: Build and push Docker image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: ${{ env.CONTEXT }} file: ${{ env.DOCKER_FILE }} @@ -149,29 +149,29 @@ jobs: matrix: environment: [ pre-release-preview ] include: - - environment: pre-release-preview - environment_prefix: pre-release - cardano_network: preview - mithril_api_domain: api.mithril.network - mithril_protocol_parameters: | - { - k = 5 - m = 100 - phi_f = 0.65 - } - mithril_signers: | - { - "2" = { - type = "verified", - pool_id = "", - }, - } - terraform_backend_bucket: hydra-terraform-admin - google_region: europe-west1 - google_zone: europe-west1-b - google_machine_type: e2-highmem-2 - google_compute_instance_boot_disk_size: 200 - google_compute_instance_data_disk_size: 250 + - environment: pre-release-preview + environment_prefix: pre-release + cardano_network: preview + mithril_api_domain: api.mithril.network + mithril_protocol_parameters: | + { + k = 5 + m = 100 + phi_f = 0.65 + } + mithril_signers: | + { + "2" = { + type = "verified", + pool_id = "", + }, + } + terraform_backend_bucket: hydra-terraform-admin + google_region: europe-west1 + google_zone: europe-west1-b + google_machine_type: e2-highmem-2 + google_compute_instance_boot_disk_size: 200 + google_compute_instance_data_disk_size: 250 environment: ${{ matrix.environment }} runs-on: ubuntu-22.04 needs: @@ -181,7 +181,7 @@ jobs: working-directory: mithril-infra steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Get Docker image id run: echo "DOCKER_IMAGE_ID=${{ github.ref_name }}-$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_ENV @@ -235,17 +235,17 @@ jobs: max-parallel: 1 matrix: package: [ mithril-stm, mithril-common, mithril-client ] - + runs-on: ubuntu-22.04 steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install stable toolchain uses: dtolnay/rust-toolchain@master with: toolchain: stable - + - name: Publish package to crates.io uses: ./.github/workflows/actions/publish-crate-package with: @@ -264,18 +264,18 @@ jobs: tag: next access: public api_token_secret_name: NPM_API_TOKEN_MITHRIL_CLIENT_WASM - + runs-on: ubuntu-22.04 steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install stable toolchain, tools, and restore cache uses: ./.github/workflows/actions/toolchain-and-cache with: cache-version: ${{ secrets.CACHE_VERSION }}-wasm cargo-tools: wasm-pack - + - name: Publish package to npm uses: ./.github/workflows/actions/publish-npm-package with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 29455611e94..e598a6991d4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: Release on: release: - types: [released] + types: [ released ] jobs: build-push-docker: @@ -29,10 +29,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Log in to the Container registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -40,7 +40,7 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.PACKAGE }} tags: | @@ -48,7 +48,7 @@ jobs: type=raw,value=${{ github.ref_name }}-{{sha}} - name: Download built artifacts (Linux-x64) - uses: dawidd6/action-download-artifact@v2 + uses: dawidd6/action-download-artifact@v3 with: name: mithril-distribution-Linux-X64 path: ${{ matrix.project }} @@ -57,7 +57,7 @@ jobs: workflow_conclusion: success - name: Build and push Docker image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: ${{ env.CONTEXT }} file: ${{ env.DOCKER_FILE }} @@ -70,48 +70,48 @@ jobs: matrix: environment: [ release-preprod, release-mainnet ] include: - - environment: release-preprod - environment_prefix: release - cardano_network: preprod - mithril_api_domain: api.mithril.network - mithril_protocol_parameters: | - { - k = 5 - m = 100 - phi_f = 0.65 - } - mithril_signers: | - { - "2" = { - type = "verified", - pool_id = "", - }, - } - terraform_backend_bucket: hydra-terraform-admin - google_region: europe-west1 - google_zone: europe-west1-b - google_machine_type: e2-highmem-2 - google_compute_instance_boot_disk_size: 200 - google_compute_instance_data_disk_size: 250 - - environment: release-mainnet - environment_prefix: release - cardano_network: mainnet - mithril_api_domain: api.mithril.network - mithril_protocol_parameters: | - { - k = 2422 - m = 20973 - phi_f = 0.20 - } - mithril_signers: | - {} - terraform_backend_bucket: mithril-terraform-prod - google_region: europe-west1 - google_zone: europe-west1-b - google_machine_type: e2-highmem-8 - google_compute_instance_boot_disk_size: 250 - google_compute_instance_data_disk_size: 1000 - + - environment: release-preprod + environment_prefix: release + cardano_network: preprod + mithril_api_domain: api.mithril.network + mithril_protocol_parameters: | + { + k = 5 + m = 100 + phi_f = 0.65 + } + mithril_signers: | + { + "2" = { + type = "verified", + pool_id = "", + }, + } + terraform_backend_bucket: hydra-terraform-admin + google_region: europe-west1 + google_zone: europe-west1-b + google_machine_type: e2-highmem-2 + google_compute_instance_boot_disk_size: 200 + google_compute_instance_data_disk_size: 250 + - environment: release-mainnet + environment_prefix: release + cardano_network: mainnet + mithril_api_domain: api.mithril.network + mithril_protocol_parameters: | + { + k = 2422 + m = 20973 + phi_f = 0.20 + } + mithril_signers: | + {} + terraform_backend_bucket: mithril-terraform-prod + google_region: europe-west1 + google_zone: europe-west1-b + google_machine_type: e2-highmem-8 + google_compute_instance_boot_disk_size: 250 + google_compute_instance_data_disk_size: 1000 + environment: ${{ matrix.environment }} runs-on: ubuntu-22.04 needs: @@ -121,7 +121,7 @@ jobs: working-directory: mithril-infra steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Get Docker image id run: echo "DOCKER_IMAGE_ID=${{ github.ref_name }}-$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_ENV @@ -174,23 +174,23 @@ jobs: matrix: package: [ mithril-stm, mithril-common, mithril-client ] include: - - package: mithril-stm - api_token_secret_name: CRATES_IO_API_TOKEN - - package: mithril-common - api_token_secret_name: CRATES_IO_API_TOKEN_MITHRIL_COMMON - - package: mithril-client - api_token_secret_name: CRATES_IO_API_TOKEN_MITHRIL_CLIENT - + - package: mithril-stm + api_token_secret_name: CRATES_IO_API_TOKEN + - package: mithril-common + api_token_secret_name: CRATES_IO_API_TOKEN_MITHRIL_COMMON + - package: mithril-client + api_token_secret_name: CRATES_IO_API_TOKEN_MITHRIL_CLIENT + runs-on: ubuntu-22.04 steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install stable toolchain uses: dtolnay/rust-toolchain@master with: toolchain: stable - + - name: Publish package to crates.io uses: ./.github/workflows/actions/publish-crate-package with: @@ -210,18 +210,18 @@ jobs: tag: latest access: public api_token_secret_name: NPM_API_TOKEN_MITHRIL_CLIENT_WASM - + runs-on: ubuntu-22.04 steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install stable toolchain, tools, and restore cache uses: ./.github/workflows/actions/toolchain-and-cache with: cache-version: ${{ secrets.CACHE_VERSION }}-wasm cargo-tools: wasm-pack - + - name: Publish package to npm uses: ./.github/workflows/actions/publish-npm-package with: diff --git a/.github/workflows/test-client.yml b/.github/workflows/test-client.yml index 260885b983f..13cb3bf6e68 100644 --- a/.github/workflows/test-client.yml +++ b/.github/workflows/test-client.yml @@ -50,7 +50,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Prepare environment variables id: prepare @@ -69,34 +69,34 @@ jobs: echo "NETWORK=${{ inputs.network }}" >> $GITHUB_ENV echo "AGGREGATOR_ENDPOINT=${{ inputs.aggregator_endpoint }}" >> $GITHUB_ENV echo "GENESIS_VERIFICATION_KEY=$(curl -s ${{ inputs.genesis_verification_key }})" >> $GITHUB_ENV - + - name: Checkout binary - uses: dawidd6/action-download-artifact@v2 + uses: dawidd6/action-download-artifact@v3 with: name: mithril-distribution-${{ runner.os }}-${{ runner.arch }} path: ./bin - commit: ${{ steps.prepare.outputs.sha }} + commit: ${{ steps.prepare.outputs.sha }} branch: ${{ steps.prepare.outputs.branch }} workflow: ci.yml workflow_conclusion: success - + - name: Set permissions shell: bash working-directory: ./bin run: chmod +x ./mithril-client - + - name: Show client version shell: bash working-directory: ./bin run: ./mithril-client ${{ steps.prepare.outputs.debug_level }} --version - + - name: Snapshot / list and get last digest shell: bash working-directory: ./bin run: | ./mithril-client ${{ steps.prepare.outputs.debug_level }} snapshot list echo "SNAPSHOT_DIGEST=$(./mithril-client snapshot list --json | jq -r '.[0].digest')" >> $GITHUB_ENV - + - name: Snapshot / download & restore latest shell: bash working-directory: ./bin @@ -108,7 +108,7 @@ jobs: run: | ./mithril-client ${{ steps.prepare.outputs.debug_level }} mithril-stake-distribution list echo "MITHRIL_STAKE_DISTRIBUTION_HASH=$(./mithril-client mithril-stake-distribution list --json | jq -r '.[0].hash')" >> $GITHUB_ENV - + - name: Mithril Stake Distribution / download & restore latest shell: bash working-directory: ./bin @@ -143,13 +143,13 @@ jobs: - name: Show client version shell: bash run: ${{ steps.command.outputs.mithril_client }} ${{ steps.prepare.outputs.debug_level }} --version - + - name: Snapshot / list and get last digest shell: bash run: | ${{ steps.command.outputs.mithril_client }} snapshot list echo "SNAPSHOT_DIGEST=$(${{ steps.command.outputs.mithril_client }} snapshot list --json | jq -r '.[0].digest')" >> $GITHUB_ENV - + - name: Snapshot / download & restore latest shell: bash run: ${{ steps.command.outputs.mithril_client }} ${{ steps.prepare.outputs.debug_level }} snapshot download $SNAPSHOT_DIGEST --download-dir /app @@ -159,10 +159,10 @@ jobs: run: | ${{ steps.command.outputs.mithril_client }} mithril-stake-distribution list echo "MITHRIL_STAKE_DISTRIBUTION_HASH=$(${{ steps.command.outputs.mithril_client }} mithril-stake-distribution list --json | jq -r '.[0].hash')" >> $GITHUB_ENV - + - name: Mithril Stake Distribution / download & restore latest shell: bash - run: ${{ steps.command.outputs.mithril_client }} ${{ steps.prepare.outputs.debug_level }} mithril-stake-distribution download $MITHRIL_STAKE_DISTRIBUTION_HASH --download-dir /app + run: ${{ steps.command.outputs.mithril_client }} ${{ steps.prepare.outputs.debug_level }} mithril-stake-distribution download $MITHRIL_STAKE_DISTRIBUTION_HASH --download-dir /app test-mithril-client-wasm: strategy: @@ -172,14 +172,14 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Download built artifacts - uses: dawidd6/action-download-artifact@v2 + uses: dawidd6/action-download-artifact@v3 with: name: mithril-distribution-wasm path: ./mithril-client-wasm - commit: ${{ steps.prepare.outputs.sha }} + commit: ${{ steps.prepare.outputs.sha }} branch: ${{ steps.prepare.outputs.branch }} workflow: ci.yml workflow_conclusion: success diff --git a/.github/workflows/test-deploy-network.yml b/.github/workflows/test-deploy-network.yml index 91505c19e8c..66cdd4e2953 100644 --- a/.github/workflows/test-deploy-network.yml +++ b/.github/workflows/test-deploy-network.yml @@ -14,7 +14,7 @@ on: required: true type: choice options: - - dev-preview + - dev-preview dry_run: description: Dry run will not deploy the distribution to the Mithril network required: true @@ -28,40 +28,40 @@ jobs: matrix: environment: [ dev-preview ] include: - - environment: dev-preview - environment_prefix: dev - cardano_network: preview - mithril_use_p2p_network: true - mithril_api_domain: api.mithril.network - mithril_era_reader_adapter_type: cardano-chain - mithril_protocol_parameters: | - { - k = 5 - m = 100 - phi_f = 0.65 - } - mithril_signers: | - { - "1" = { - type = "unverified", - pool_id = "pool1vapqexnsx6hvc588yyysxpjecf3k43hcr5mvhmstutuvy085xpa", - }, - "2" = { - type = "unverified", - pool_id = "pool1t9uuagsat8hlr0n0ga4wzge0jxlyjuhl6mugrm8atc285vzkf2e", - }, - "3" = { - type = "unverified", - pool_id = "pool1r0tln8nct3mpyvehgy6uu3cdlmjnmtr2fxjcqnfl6v0qg0we42e", - }, - } - terraform_backend_bucket: hydra-terraform-admin - google_region: europe-west1 - google_zone: europe-west1-b - google_machine_type: e2-highmem-4 - google_compute_instance_boot_disk_size: 200 - google_compute_instance_data_disk_size: 250 - + - environment: dev-preview + environment_prefix: dev + cardano_network: preview + mithril_use_p2p_network: true + mithril_api_domain: api.mithril.network + mithril_era_reader_adapter_type: cardano-chain + mithril_protocol_parameters: | + { + k = 5 + m = 100 + phi_f = 0.65 + } + mithril_signers: | + { + "1" = { + type = "unverified", + pool_id = "pool1vapqexnsx6hvc588yyysxpjecf3k43hcr5mvhmstutuvy085xpa", + }, + "2" = { + type = "unverified", + pool_id = "pool1t9uuagsat8hlr0n0ga4wzge0jxlyjuhl6mugrm8atc285vzkf2e", + }, + "3" = { + type = "unverified", + pool_id = "pool1r0tln8nct3mpyvehgy6uu3cdlmjnmtr2fxjcqnfl6v0qg0we42e", + }, + } + terraform_backend_bucket: hydra-terraform-admin + google_region: europe-west1 + google_zone: europe-west1-b + google_machine_type: e2-highmem-4 + google_compute_instance_boot_disk_size: 200 + google_compute_instance_data_disk_size: 250 + environment: ${{ matrix.environment }} runs-on: ubuntu-22.04 defaults: @@ -70,7 +70,7 @@ jobs: steps: - name: Checkout sources if: inputs.environment == matrix.environment - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: ${{ inputs.dry_run == true && 'Plan' || 'Apply' }} terraform infrastructure if: inputs.environment == matrix.environment diff --git a/.github/workflows/test-docker-distribution.yml b/.github/workflows/test-docker-distribution.yml index 61b5019436f..54a206eb415 100644 --- a/.github/workflows/test-docker-distribution.yml +++ b/.github/workflows/test-docker-distribution.yml @@ -39,7 +39,7 @@ jobs: permissions: contents: read - packages: write + packages: write env: REGISTRY: ghcr.io @@ -50,7 +50,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Get short SHA id: slug @@ -61,7 +61,7 @@ jobs: git checkout ${{ inputs.commit_sha }} - name: Download built artifacts (Linux-x64) - uses: dawidd6/action-download-artifact@v2 + uses: dawidd6/action-download-artifact@v3 with: name: mithril-distribution-Linux-X64 path: ${{ matrix.project }} @@ -70,7 +70,7 @@ jobs: workflow_conclusion: completed - name: Log in to the Container registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -78,7 +78,7 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.PACKAGE }} tags: | @@ -86,7 +86,7 @@ jobs: type=raw,value=test-${{ inputs.distribution_code }}-${{ steps.slug.outputs.sha8 }} - name: Build and push Docker image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: ${{ env.CONTEXT }} file: ${{ env.DOCKER_FILE }}