Skip to content

Commit

Permalink
Merge with 5.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-mrq committed May 5, 2024
1 parent db54928 commit fbf4f78
Show file tree
Hide file tree
Showing 48 changed files with 1,605 additions and 123 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/awesome-ideas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- uses: hmarr/debug-action@v3

- uses: actions/checkout@v4.1.2
- uses: actions/checkout@v4.1.4

- uses: JasonEtco/create-an-issue@v2
if: github.event.discussion.category.name == 'Ideas'
Expand All @@ -20,7 +20,7 @@ jobs:
with:
filename: .github/issue_from_discussion.md

- uses: actions/add-to-project@v1.0.0
- uses: actions/add-to-project@v1.0.1
with:
project-url: https://github.com/orgs/CGI-FR/projects/1
github-token: ${{ steps.generate_app_token.outputs.token }}
2 changes: 1 addition & 1 deletion .github/workflows/aws-cfn-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
repo: context.repo.repo,
labels: ['cfn-templates']
})
- uses: actions/checkout@v4.1.2
- uses: actions/checkout@v4.1.4

- name: Check CloudFormation Syntax
uses: scottbrenner/cfn-lint-action@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/aws_deploy_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
outputs:
aws_public_registry: ${{ steps.login-ecr-public.outputs.registry }}
steps:
- uses: actions/checkout@v4.1.2
- uses: actions/checkout@v4.1.4

- id: docker-tag
uses: yuya-takeyama/docker-tag-from-github-ref-action@v1
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
environment:
name: AWS Staging
steps:
- uses: actions/checkout@v4.1.2
- uses: actions/checkout@v4.1.4

- name: Configure AWS credentials
id: aws-credentials
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bicep-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
labels: ['arm-templates']
})
- uses: actions/checkout@v4.1.2
- uses: actions/checkout@v4.1.4
with:
submodules: recursive

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-open-api-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4.1.2
- uses: actions/checkout@v4.1.4

- name: Setup .NET
uses: actions/setup-dotnet@v4
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
needs: [ build ]
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4.1.2
- uses: actions/checkout@v4.1.4
with:
ref: 'docs/main'

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4.1.2
- uses: actions/checkout@v4.1.4

- name: Setup .NET
uses: actions/setup-dotnet@v4
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
needs: unit-test
steps:

- uses: actions/checkout@v4.1.2
- uses: actions/checkout@v4.1.4

- uses: actions/download-artifact@v4
with:
Expand All @@ -71,7 +71,7 @@ jobs:
src/IoTHub.Portal.Tests.Unit/TestResults
- name: Upload to Codecov test reports
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: src/IoTHub.Portal.Tests.Unit/TestResults
Expand All @@ -85,7 +85,7 @@ jobs:

# steps:

# - uses: actions/checkout@v4.1.2
# - uses: actions/checkout@v4.1.4

# - name: Setup .NET
# uses: actions/setup-dotnet@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4.1.2
uses: actions/checkout@v4.1.4

- name: Setup .NET
uses: actions/setup-dotnet@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/delete-documentation-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Delete Documentation Version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.2
- uses: actions/checkout@v4.1.4
with:
ref: docs/main
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4.1.2
- uses: actions/checkout@v4.1.4

- id: docker-tag
uses: yuya-takeyama/docker-tag-from-github-ref-action@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
app_id: ${{ secrets.BOT_APP_ID }}
private_key: ${{ secrets.BOT_PRIVATE_KEY }}

- uses: actions/add-to-project@v1.0.0
- uses: actions/add-to-project@v1.0.1
with:
project-url: https://github.com/orgs/CGI-FR/projects/1
github-token: ${{ steps.generate_app_token.outputs.token }}
4 changes: 2 additions & 2 deletions .github/workflows/lint-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
lint-documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.2
- uses: DavidAnson/markdownlint-cli2-action@v15
- uses: actions/checkout@v4.1.4
- uses: DavidAnson/markdownlint-cli2-action@v16
with:
globs: 'docs/**/*.md'
2 changes: 1 addition & 1 deletion .github/workflows/publish-documentation-new-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
name: Publish Documentation with New Version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.2
- uses: actions/checkout@v4.1.4
with:
ref: docs/main
fetch-depth: 0
Expand Down
87 changes: 86 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4.1.2
- uses: actions/checkout@v4.1.4

- id: docker-tag
uses: yuya-takeyama/docker-tag-from-github-ref-action@v1
Expand Down Expand Up @@ -67,3 +67,88 @@ jobs:
GITHUB_RUN_NUMBER=${{ github.run_number }}
tags:
${{ steps.meta.outputs.tags }}

arm_templates:
name: Publish cloud infrastructure templates
# The type of runner that the job will run on
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4.1.4

- name: Get semver
id: version
uses: docker/metadata-action@v5
with:
images: |
${{ env.registry_name }}/${{ github.repository_owner }}/${{ env.image_name }}
tags: |
type=semver,pattern={{version}}
- uses: actions/checkout@v4.1.4
with:
path: IoT-Hub-Portal
submodules: recursive

- uses: actions/checkout@v4.1.4
with:
ref: arm/main
path: arm-templates

- name: Generate app token
id: generate_app_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.BOT_APP_ID }}
private_key: ${{ secrets.BOT_PRIVATE_KEY }}

- name: Copy templates
working-directory: arm-templates
run: |
rm -rf ./templates/
mkdir -p templates/azure/iotedge-lorawan-starterkit
touch ./templates/.gitkeep
cp -r ../IoT-Hub-Portal/templates/* ./templates/
rm -rf ./templates/iotedge-lorawan-starterkit/
cp -r ../IoT-Hub-Portal/templates/iotedge-lorawan-starterkit/TemplateBicep/* ./templates/azure/iotedge-lorawan-starterkit/
sed -r -i 's/..\/iotedge-lorawan-starterkit\/TemplateBicep\/main.bicep/.\/iotedge-lorawan-starterkit\/main.bicep/g' ./templates/azure/portal_with_lorawan_and_starter_kit.bicep
- name: Update IoTHub Portal docker image tag in app_service.bicep
working-directory: arm-templates/templates/azure
run: sed -i 's/ghcr.io\/cgi-fr\/iothub-portal:latest/ghcr.io\/cgi-fr\/iothub-portal:${{ fromJSON(steps.version.outputs.json).labels['org.opencontainers.image.version'] }}/g' app_service.bicep

- name: Update IoTHub Portal docker image tag in awsdeploy.yml
working-directory: arm-templates/templates/aws
run: |
sed -i 's/public.ecr.aws\/cgi-fr\/iothub-portal:latest/public.ecr.aws\/cgi-fr\/iothub-portal:${{ fromJSON(steps.version.outputs.json).labels['org.opencontainers.image.version'] }}/g' awsdeploy.yml
- name: Generate ARM file
working-directory: arm-templates/templates/azure
run: az bicep build --file azuredeploy.bicep --outfile azuredeploy.json

- name: Upload azure templates to release assets
uses: AButler/upload-release-assets@v3.0
with:
files: 'arm-templates/templates/azure/*.json'
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload aws templates to release assets
uses: AButler/upload-release-assets@v3.0
with:
files: 'arm-templates/templates/aws/*.yml'
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Create PR for template updates
uses: peter-evans/create-pull-request@v6
with:
base: 'arm/main'
branch: 'arm/feature/update-templates'
path: 'arm-templates'
commit-message: 'Update templates from release.'
token: ${{ steps.generate_app_token.outputs.token }}
title: '[ARM Templates] Update templates from release'
labels: |
arm-templates
automated pr
body: |
Automated changes to the Azure templates.
19 changes: 5 additions & 14 deletions src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,23 @@ WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM node:14-bullseye AS build

RUN wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
RUN dpkg -i packages-microsoft-prod.deb
RUN rm packages-microsoft-prod.deb
RUN apt-get update; \
apt-get install -y apt-transport-https && \
apt-get update && \
apt-get install -y dotnet-sdk-8.0

FROM build AS builder
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_VERSION=1.2.3
ARG GITHUB_RUN_NUMBER=4
WORKDIR /src
RUN ls
COPY ["IoTHub.Portal.Server/IoTHub.Portal.Server.csproj", "IoTHub.Portal.Server/"]
COPY ["IoTHub.Portal.Shared/IoTHub.Portal.Shared.csproj", "IoTHub.Portal.Shared/"]
COPY ["IoTHub.Portal.Client/IoTHub.Portal.Client.csproj", "IoTHub.Portal.Client/"]
RUN dotnet restore "IoTHub.Portal.Server/IoTHub.Portal.Server.csproj"
COPY . .
WORKDIR "/src/IoTHub.Portal.Server"
RUN dotnet build "IoTHub.Portal.Server.csproj" -c Release -o /app/build -p:Version="${BUILD_VERSION}.${GITHUB_RUN_NUMBER}" -p:ClientAssetsRestoreCommand="npm ci"
RUN dotnet build "IoTHub.Portal.Server.csproj" -c Release -o /app/build -p:Version="${BUILD_VERSION}.${GITHUB_RUN_NUMBER}"

FROM builder AS publish
FROM build AS publish
ARG BUILD_VERSION=1.2.3
ARG GITHUB_RUN_NUMBER=4
RUN dotnet publish "IoTHub.Portal.Server.csproj" -c Release -o /app/publish -p:Version="${BUILD_VERSION}.${GITHUB_RUN_NUMBER}" -p:ClientAssetsRestoreCommand="npm ci"
RUN dotnet publish "IoTHub.Portal.Server.csproj" -c Release -o /app/publish -p:Version="${BUILD_VERSION}.${GITHUB_RUN_NUMBER}"

FROM base AS final
WORKDIR /app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Include="AutoMapper" Version="12.0.1" />
<PackageReference Include="AWSSDK.IoT" Version="3.7.307.12" />
<PackageReference Include="AWSSDK.IotData" Version="3.7.300.63" />
<PackageReference Include="AWSSDK.IotData" Version="3.7.300.72" />
<PackageReference Include="Azure.Messaging.EventHubs" Version="5.11.1" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.1" />
<PackageReference Include="Microsoft.Azure.Devices.Provisioning.Service" Version="1.18.4" />
Expand Down
12 changes: 6 additions & 6 deletions src/IoTHub.Portal.Client/IoTHub.Portal.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

<ItemGroup>
<PackageReference Include="ChartJs.Blazor.Fork" Version="2.0.2" />
<PackageReference Include="Blazored.LocalStorage" Version="4.4.0" />
<PackageReference Include="FluentValidation" Version="11.9.0" />
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
<PackageReference Include="FluentValidation" Version="11.9.1" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
Expand All @@ -28,17 +28,17 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="5.4.3">
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="5.4.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MudBlazor" Version="6.11.0" />
<PackageReference Include="MudBlazor" Version="6.19.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Net.Http.Json" Version="8.0.0" />
<PackageReference Include="Tewr.Blazor.FileReader" Version="3.3.2.23201" />

<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.2" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.4" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.2" />
<PackageReference Include="Toolbelt.Blazor.LoadingBar" Version="14.0.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<PackageReference Include="prometheus-net" Version="8.0.0" />
<PackageReference Include="Quartz" Version="3.6.2" />
<PackageReference Include="Quartz.Extensions.DependencyInjection" Version="3.6.2" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.3" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.4" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.1" />
<PackageReference Include="EntityFrameworkCore.Exceptions.PostgreSQL" Version="6.0.3" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@
<ItemGroup>
<PackageReference Include="AWSSDK.GreengrassV2" Version="3.7.300.65" />
<PackageReference Include="AWSSDK.IoT" Version="3.7.307.12" />
<PackageReference Include="AWSSDK.IotData" Version="3.7.300.63" />
<PackageReference Include="AWSSDK.S3" Version="3.7.307.5" />
<PackageReference Include="AWSSDK.IotData" Version="3.7.300.72" />
<PackageReference Include="AWSSDK.S3" Version="3.7.307.13" />
<PackageReference Include="AWSSDK.SecretsManager" Version="3.7.302.29" />
<PackageReference Include="Azure.Data.Tables" Version="12.8.3" />
<PackageReference Include="Azure.Messaging.EventHubs" Version="5.11.1" />
Expand Down Expand Up @@ -141,7 +141,7 @@
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.0" />
<PackageReference Include="prometheus-net" Version="8.2.1" />
<PackageReference Include="Quartz.Extensions.DependencyInjection" Version="3.8.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.3" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.4" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.10" />
<PackageReference Include="EntityFrameworkCore.Exceptions.PostgreSQL" Version="8.0.0" />
</ItemGroup>
Expand Down
Loading

0 comments on commit fbf4f78

Please sign in to comment.