Skip to content

Commit

Permalink
Merge pull request #2644 from planetarium/release/220
Browse files Browse the repository at this point in the history
Release 220
  • Loading branch information
U-lis authored Nov 27, 2024
2 parents 7d0e233 + 2cac22a commit 08308b1
Show file tree
Hide file tree
Showing 24 changed files with 217 additions and 383 deletions.
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ updates:
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
2 changes: 1 addition & 1 deletion .github/workflows/deploy_gh_pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- name: Copy GraphQL Schema to deploy
run: cp schema.graphql public/schema.graphql
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
60 changes: 20 additions & 40 deletions .github/workflows/push_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,33 +43,22 @@ jobs:
docker login \
--username '${{ secrets.DOCKER_USERNAME }}' \
--password '${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}'
- name: setup-qemu
run: |
docker run --rm --privileged multiarch/qemu-user-static \
--reset \
-p yes
- name: build-and-push-amd64
run: |
docker build . \
-f ${{ matrix.docker.dockerfile }}.amd64 \
-t ${{ matrix.docker.repo }}:git-${{ github.sha }}-amd64 \
--build-arg COMMIT=git-${{ github.sha }} \
--build-arg TARGETPLATFORM=linux/amd64
docker push ${{ matrix.docker.repo }}:git-${{ github.sha }}-amd64
- name: build-and-push-arm64v8
run: |
docker build . \
-f ${{ matrix.docker.dockerfile }}.arm64v8 \
-t ${{ matrix.docker.repo }}:git-${{ github.sha }}-arm64v8 \
--build-arg COMMIT=git-${{ github.sha }} \
--build-arg TARGETPLATFORM=linux/arm64
docker push ${{ matrix.docker.repo }}:git-${{ github.sha }}-arm64v8
- name: merge-manifest-and-push
run: |
docker manifest create ${{ matrix.docker.repo }}:git-${{ github.sha }} \
--amend ${{ matrix.docker.repo }}:git-${{ github.sha }}-amd64 \
--amend ${{ matrix.docker.repo }}:git-${{ github.sha }}-arm64v8
docker manifest push ${{ matrix.docker.repo }}:git-${{ github.sha }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/arm/v8,linux/amd64
- name: Build and push
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/arm64,linux/amd64
tags: ${{ matrix.docker.repo }}:git-${{ github.sha }}
file: ${{ matrix.docker.dockerfile }}
build-args: COMMIT=git-${{ github.sha }}
env:
BUILDKIT_PROGRESS: 'plain'

tag:
name: tag (${{ matrix.docker.repo }})
Expand All @@ -87,23 +76,14 @@ jobs:
--password '${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}'
- name: push git tagged version
run: |
docker pull ${{ matrix.docker.repo }}:git-${{ github.sha }}-amd64
docker pull ${{ matrix.docker.repo }}:git-${{ github.sha }}
if [[ -z "${{ github.event.inputs.imageTag }}" ]]; then
export IMAGE_TAG=${{ github.ref_name }}
else
export IMAGE_TAG=${{ github.event.inputs.imageTag }}
fi
docker tag \
${{ matrix.docker.repo }}:git-${{ github.sha }}-amd64 \
${{ matrix.docker.repo }}:$IMAGE_TAG-amd64
docker push ${{ matrix.docker.repo }}:$IMAGE_TAG-amd64
docker pull ${{ matrix.docker.repo }}:git-${{ github.sha }}-arm64v8
docker tag \
${{ matrix.docker.repo }}:git-${{ github.sha }}-arm64v8 \
${{ matrix.docker.repo }}:$IMAGE_TAG-arm64v8
docker push ${{ matrix.docker.repo }}:$IMAGE_TAG-arm64v8
docker manifest create ${{ matrix.docker.repo }}:$IMAGE_TAG \
--amend ${{ matrix.docker.repo }}:$IMAGE_TAG-amd64 \
--amend ${{ matrix.docker.repo }}:$IMAGE_TAG-arm64v8
docker manifest push ${{ matrix.docker.repo }}:$IMAGE_TAG
${{ matrix.docker.repo }}:git-${{ github.sha }} \
${{ matrix.docker.repo }}:$IMAGE_TAG
docker push ${{ matrix.docker.repo }}:$IMAGE_TAG
5 changes: 5 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<LibplanetVersion>5.4.1</LibplanetVersion>
</PropertyGroup>
</Project>
16 changes: 2 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /app
ARG COMMIT
ARG TARGETPLATFORM

# Copy csproj and restore as distinct layers
COPY ./Lib9c/Lib9c/Lib9c.csproj ./Lib9c/
COPY ./Libplanet.Headless/Libplanet.Headless.csproj ./Libplanet.Headless/
COPY ./NineChronicles.RPC.Shared/NineChronicles.RPC.Shared/NineChronicles.RPC.Shared.csproj ./NineChronicles.RPC.Shared/
COPY ./NineChronicles.Headless/NineChronicles.Headless.csproj ./NineChronicles.Headless/
COPY ./NineChronicles.Headless.Executable/NineChronicles.Headless.Executable.csproj ./NineChronicles.Headless.Executable/
RUN dotnet restore Lib9c
RUN dotnet restore Libplanet.Headless
RUN dotnet restore NineChronicles.RPC.Shared
RUN dotnet restore NineChronicles.Headless
RUN dotnet restore NineChronicles.Headless.Executable

# Copy everything else and build
COPY . ./
RUN <<EOF
Expand Down Expand Up @@ -43,7 +31,7 @@ fi
EOF

# Build runtime image
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim

Check warning on line 34 in Dockerfile

View workflow job for this annotation

GitHub Actions / build_and_push (planetariumhq/ninechronicles-headless)

Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior

RedundantTargetPlatform: Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior More info: https://docs.docker.com/go/dockerfile/rule/redundant-target-platform/
WORKDIR /app
COPY --from=build-env /app/out .

Expand Down
12 changes: 2 additions & 10 deletions Dockerfile.ACC
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
# Use the SDK image to build the app
FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build-env
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /app
ARG COMMIT
ARG TARGETPLATFORM

# Copy csproj and restore as distinct layers
COPY ./Lib9c/Lib9c/Lib9c.csproj ./Lib9c/
COPY ./NineChronicles.Headless/NineChronicles.Headless.csproj ./NineChronicles.Headless/
COPY ./NineChronicles.Headless.AccessControlCenter/NineChronicles.Headless.AccessControlCenter.csproj ./NineChronicles.Headless.AccessControlCenter/
RUN dotnet restore Lib9c
RUN dotnet restore NineChronicles.Headless
RUN dotnet restore NineChronicles.Headless.AccessControlCenter

# Copy everything else and build
COPY . ./
RUN <<EOF
Expand Down Expand Up @@ -40,7 +32,7 @@ fi
EOF

# Build runtime image
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim

Check warning on line 35 in Dockerfile.ACC

View workflow job for this annotation

GitHub Actions / build_and_push (planetariumhq/access-control-center)

Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior

RedundantTargetPlatform: Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior More info: https://docs.docker.com/go/dockerfile/rule/redundant-target-platform/
WORKDIR /app
RUN apt-get update && apt-get install -y libc6-dev
COPY --from=build-env /app/out .
Expand Down
2 changes: 1 addition & 1 deletion Lib9c
Submodule Lib9c updated 459 files
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Libplanet.Extensions.ForkableActionEvaluator\Libplanet.Extensions.ForkableActionEvaluator.csproj" />
<ProjectReference Include="..\Lib9c\.Libplanet.Extensions.ActionEvaluatorCommonComponents\Libplanet.Extensions.ActionEvaluatorCommonComponents.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Lib9c\.Libplanet\src\Libplanet\Libplanet.csproj" />
<PackageReference Include="Libplanet.Action" Version="$(LibplanetVersion)" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Lib9c\.Libplanet\src\Libplanet\Libplanet.csproj" />
<ProjectReference Include="..\Lib9c\.Lib9c.Plugin.Shared\Lib9c.Plugin.Shared.csproj" />
<ProjectReference Include="..\Lib9c\.Libplanet.Extensions.ActionEvaluatorCommonComponents\Libplanet.Extensions.ActionEvaluatorCommonComponents.csproj" />
</ItemGroup>


<ItemGroup>
<PackageReference Include="Libplanet.Action" Version="$(LibplanetVersion)" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions Libplanet.Headless/Libplanet.Headless.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Libplanet.Explorer" Version="$(LibplanetVersion)" />
<PackageReference Include="Libplanet.Net" Version="$(LibplanetVersion)" />
<PackageReference Include="Libplanet.RocksDBStore" Version="$(LibplanetVersion)" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.1" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.49.0.57237">
<PrivateAssets>all</PrivateAssets>
Expand All @@ -19,9 +22,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Lib9c\.Libplanet\src\Libplanet\Libplanet.csproj" />
<ProjectReference Include="..\Lib9c\.Libplanet\src\Libplanet.RocksDBStore\Libplanet.RocksDBStore.csproj" />
<ProjectReference Include="..\Lib9c\.Libplanet\src\Libplanet.Net\Libplanet.Net.csproj" />
<ProjectReference Include="..\NineChronicles.RPC.Shared\NineChronicles.RPC.Shared\NineChronicles.RPC.Shared.csproj" />
<ProjectReference Include="..\Libplanet.Extensions.ForkableActionEvaluator\Libplanet.Extensions.ForkableActionEvaluator.csproj" />
<ProjectReference Include="..\Libplanet.Extensions.PluggedActionEvaluator\Libplanet.Extensions.PluggedActionEvaluator.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

<ItemGroup>
<ProjectReference Include="..\NineChronicles.Headless.Executable\NineChronicles.Headless.Executable.csproj" />
<ProjectReference Include="..\Lib9c\.Libplanet\test\Libplanet.Mocks\Libplanet.Mocks.csproj" />
</ItemGroup>

</Project>
Loading

0 comments on commit 08308b1

Please sign in to comment.