Skip to content

1.2.2

1.2.2 #59

Workflow file for this run

name: release
on:
release:
types: [published]
env:
DOTNET_VERSION: "7.0.x"
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: Setup .NET SDK
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build linux binaries
run: |
cd apps/DataAggregator
dotnet publish --runtime linux-x64 --configuration Release --self-contained false -p:PublishReadyToRun=true -p:DebugType=None -p:DebugSymbols=false --output ./output
cd ../DatabaseMigrations
dotnet publish --runtime linux-x64 --configuration Release --self-contained false -p:PublishReadyToRun=true -p:DebugType=None -p:DebugSymbols=false --output ./output
cd ../GatewayApi
dotnet publish --runtime linux-x64 --configuration Release --self-contained false -p:PublishReadyToRun=true -p:DebugType=None -p:DebugSymbols=false --output ./output
cd ../..
zip -r data-aggregator.zip apps/DataAggregator/output/
zip -r database-migrations.zip apps/DatabaseMigrations/output/
zip -r gateway-api.zip apps/GatewayApi/output/
- name: Move zip
run: |
mv ./data-aggregator.zip data-aggregator-${{ github.event.release.tag_name }}-linux-x64.zip
mv ./gateway-api.zip gateway-api-${{ github.event.release.tag_name }}-linux-x64.zip
mv ./database-migrations.zip database-migrations-${{ github.event.release.tag_name }}-linux-x64.zip
- name: Upload DataAggreagtor zip
uses: softprops/action-gh-release@c9b46fe7aad9f02afd89b12450b780f52dacfb2d
with:
files: |
data-aggregator-${{ github.event.release.tag_name }}-linux-x64.zip
gateway-api-${{ github.event.release.tag_name }}-linux-x64.zip
database-migrations-${{ github.event.release.tag_name }}-linux-x64.zip
setup-tags:
runs-on: ubuntu-22.04
outputs:
version-suffix: ${{ steps.setup_tags.outputs.version-suffix }}
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- name: Get rele ase
id: get_release
uses: bruceadams/get-release@f589ce0779c7bef1faf175f7488c972eb47dc046
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Setup tags for docker image
id: setup_tags
uses: ./.github/actions/set-variables
with:
github_event_name: ${{ github.event_name }}
github_action_name: ${{ github.event.action}}
- name: Publish Gateway Settings
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
with:
path: Directory.Build.props
name: build_props
retention-days: 1
docker-database-migrations-dockerhub:
name: AMD DatabaseMigrations
needs:
- setup-tags
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/docker-build.yml@main
with:
runs_on: ubuntu-22.04
image_registry: "docker.io"
image_organization: "radixdlt"
image_name: "babylon-ng-database-migrations"
tag: ${{ needs.setup-tags.outputs.version-suffix }}-amd64
context: "."
dockerfile: "./apps/DatabaseMigrations/Dockerfile"
platforms: "linux/amd64"
cache_tag_suffix: "AMD"
enable_dockerhub: "true"
restore_artifact: "true"
artifact_location: "./"
artifact_name: build_props
provenance: "false"
secrets:
role_to_assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }}
docker-database-migrations-dockerhub-arm:
name: ARM DatabaseMigrations
needs:
- setup-tags
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/docker-build.yml@main
with:
runs_on: babylon-gateway-arm
image_registry: "docker.io"
image_organization: "radixdlt"
image_name: "babylon-ng-database-migrations"
tag: ${{ needs.setup-tags.outputs.version-suffix }}-arm64
context: "."
dockerfile: "./apps/DatabaseMigrations/Dockerfile"
platforms: "linux/arm64"
environment: release
cache_tag_suffix: "ARM"
enable_dockerhub: "true"
restore_artifact: "true"
artifact_location: "./"
artifact_name: build_props
provenance: "false"
disable_qemu: true
secrets:
role_to_assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }}
docker-data-aggregator-dockerhub:
name: AMD DataAggregator
needs:
- setup-tags
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/docker-build.yml@main
with:
runs_on: ubuntu-22.04
image_registry: "docker.io"
image_organization: "radixdlt"
image_name: "babylon-ng-data-aggregator"
tag: ${{ needs.setup-tags.outputs.version-suffix }}-amd64
context: "."
dockerfile: "./apps/DataAggregator/Dockerfile"
platforms: "linux/amd64"
cache_tag_suffix: "AMD"
enable_dockerhub: "true"
restore_artifact: "true"
artifact_location: "./"
artifact_name: build_props
provenance: false
secrets:
role_to_assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }}
docker-data-aggregator-dockerhub-arm:
name: ARM DataAggregator
needs:
- setup-tags
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/docker-build.yml@main
with:
runs_on: babylon-gateway-arm
image_registry: "docker.io"
image_organization: "radixdlt"
image_name: "babylon-ng-data-aggregator"
tag: ${{ needs.setup-tags.outputs.version-suffix }}-arm64
context: "."
dockerfile: "./apps/DataAggregator/Dockerfile"
platforms: "linux/arm64"
environment: release
cache_tag_suffix: "ARM"
enable_dockerhub: "true"
restore_artifact: "true"
artifact_location: "./"
artifact_name: build_props
provenance: false
disable_qemu: true
secrets:
role_to_assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }}
docker-gateway-api-dockerhub:
name: AMD GatewayApi
needs:
- setup-tags
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/docker-build.yml@main
with:
runs_on: ubuntu-22.04
image_registry: "docker.io"
image_organization: "radixdlt"
image_name: "babylon-ng-gateway-api"
tag: ${{ needs.setup-tags.outputs.version-suffix }}-amd64
context: "."
dockerfile: "./apps/GatewayApi/Dockerfile"
platforms: "linux/amd64"
cache_tag_suffix: "AMD"
enable_dockerhub: "true"
restore_artifact: "true"
artifact_location: "./"
artifact_name: build_props
provenance: false
secrets:
role_to_assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }}
docker-gateway-api-dockerhub-arm:
name: ARM GatewayApi
needs:
- setup-tags
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/docker-build.yml@main
with:
runs_on: babylon-gateway-arm
image_registry: "docker.io"
image_organization: "radixdlt"
image_name: "babylon-ng-gateway-api"
tag: ${{ needs.setup-tags.outputs.version-suffix }}-arm64
context: "."
dockerfile: "./apps/GatewayApi/Dockerfile"
platforms: "linux/arm64"
environment: release
cache_tag_suffix: "ARM"
enable_dockerhub: "true"
restore_artifact: "true"
artifact_location: "./"
artifact_name: build_props
provenance: false
disable_qemu: true
secrets:
role_to_assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }}
join-gateway-images:
name: Gateway
needs:
- setup-tags
- docker-gateway-api-dockerhub
- docker-gateway-api-dockerhub-arm
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/merge-docker-images.yml@main
with:
image_name: babylon-ng-gateway-api
image_tag: ${{ needs.setup-tags.outputs.version-suffix }}
tag_suffix_1: amd64
tag_suffix_2: arm64
aws_dockerhub_secret: github-actions/rdxworks/dockerhub-images/release-credentials
secrets:
role-to-assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }}
join-aggregator-images:
name: Aggregator
needs:
- setup-tags
- docker-data-aggregator-dockerhub
- docker-data-aggregator-dockerhub-arm
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/merge-docker-images.yml@main
with:
image_name: babylon-ng-data-aggregator
image_tag: ${{ needs.setup-tags.outputs.version-suffix }}
tag_suffix_1: amd64
tag_suffix_2: arm64
aws_dockerhub_secret: github-actions/rdxworks/dockerhub-images/release-credentials
secrets:
role-to-assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }}
join-migrations-images:
name: Migration
needs:
- setup-tags
- docker-database-migrations-dockerhub
- docker-database-migrations-dockerhub-arm
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/merge-docker-images.yml@main
with:
image_name: babylon-ng-database-migrations
image_tag: ${{ needs.setup-tags.outputs.version-suffix }}
tag_suffix_1: amd64
tag_suffix_2: arm64
aws_dockerhub_secret: github-actions/rdxworks/dockerhub-images/release-credentials
secrets:
role-to-assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }}
snyk-container-monitor:
name: Snyk monitor container
runs-on: ubuntu-latest
needs:
- setup-tags
- join-gateway-images
- join-aggregator-images
- join-migrations-images
permissions:
id-token: write
pull-requests: read
contents: read
deployments: write
strategy:
matrix:
app: ["database-migrations", "data-aggregator", "gateway-api"]
steps:
- name: snyk ${{ matrix.app }} container monitor
uses: radixdlt/public-iac-resuable-artifacts/snyk-container-monitor@main
with:
role_name: ${{ secrets.AWS_ROLE_NAME_SNYK_SECRET }}
app_name: 'babylon-gateway'
step_name: 'snyk-container-monitor'
dockerhub_secret_name: ${{ secrets.AWS_SECRET_NAME_DOCKERHUB }}
snyk_secret_name: ${{ secrets.AWS_SECRET_NAME_SNYK }}
parse_json: true
snyk_org_id: ${{ secrets.SNYK_ORG_ID }}
image: docker.io/radixdlt/babylon-ng-${{ matrix.app }}:${{ needs.setup-tags.outputs.version-suffix }}
target_ref: ${{ github.ref_name }}
snyk-monitor:
name: Snyk monitor
runs-on: ubuntu-latest
needs:
- docker-database-migrations-dockerhub
- docker-data-aggregator-dockerhub
- docker-gateway-api-dockerhub
permissions:
id-token: write
pull-requests: read
contents: read
deployments: write
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: ${{ secrets.AWS_ROLE_NAME_SNYK_SECRET }}
app_name: 'babylon-gateway'
step_name: 'snyk-monitor'
secret_prefix: 'SNYK'
secret_name: ${{ secrets.AWS_SECRET_NAME_SNYK }}
parse_json: true
- name: Setup .NET SDK
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Install dependencies
run: dotnet restore
- name: Enable Snyk online monitoring to check for vulnerabilities
uses: snyk/actions/dotnet@b98d498629f1c368650224d6d212bf7dfa89e4bf # v0.4.0
with:
args: --all-projects --org=${{ env.SNYK_NETWORK_ORG_ID }} --target-reference=${{ github.ref_name }}
command: monitor
snyk-sbom:
name: Snyk SBOM
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: ${{ secrets.AWS_ROLE_NAME_SNYK_SECRET }}
app_name: 'babylon-gateway'
step_name: 'snyk-sbom'
secret_prefix: 'SNYK'
secret_name: ${{ secrets.AWS_SECRET_NAME_SNYK }}
parse_json: true
- name: Setup .NET SDK
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Install dependencies
run: dotnet restore
- name: Generate SBOM
uses: snyk/actions/node@b98d498629f1c368650224d6d212bf7dfa89e4bf # v0.4.0
with:
args: --all-projects --org=${{ env.SNYK_NETWORK_ORG_ID }} --format=cyclonedx1.4+json --json-file-output sbom.json
command: sbom
- name: Upload SBOM
uses: softprops/action-gh-release@c9b46fe7aad9f02afd89b12450b780f52dacfb2d
with:
files: sbom.json