Skip to content

Add documentation for Docker usage #212

Add documentation for Docker usage

Add documentation for Docker usage #212

Workflow file for this run

name: CI
on:
push:
branches:
- main
- 'fix/*'
- 'feature/*'
- 'support/*'
paths:
- '**'
- '!docs/**'
pull_request:
branches:
- main
- 'support/*'
paths:
- '**'
- '!docs/**'
repository_dispatch:
types: [release]
env:
DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX: 2
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: 1
ENABLED_DIAGNOSTICS: ${{ secrets.ENABLED_DIAGNOSTICS }}
permissions:
contents: read
packages: write
jobs:
prepare:
name: Prepare Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
fail-fast: false
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Cache cake frosting
id: cache-cake
uses: actions/[email protected]
with:
path: run
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
-
name: Setup .NET SDK
uses: actions/[email protected]
with:
dotnet-version: '7.0.x'
dotnet-quality: 'preview'
-
name: '[Prepare]'
if: steps.cache-cake.outputs.cache-hit != 'true'
run: dotnet build build/CI.sln --configuration=Release
build:
name: Build code & Package
needs: [prepare]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
fail-fast: false
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Use cached cake frosting
id: cache-cake
uses: actions/[email protected]
with:
path: run
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
-
name: Use cached tools
id: cache-tools
uses: actions/[email protected]
with:
path: tools
key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }}
-
name: Setup .NET SDK
uses: actions/[email protected]
with:
dotnet-version: '7.0.x'
dotnet-quality: 'preview'
-
name: '[Build]'
shell: pwsh
run: dotnet run/build.dll --target=Package
-
name: 'Upload nuget packages'
uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
with:
name: nuget
path: ${{ github.workspace }}/artifacts/packages/nuget
-
name: 'Upload native packages'
uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
with:
name: native-${{ runner.os }}
path: ${{ github.workspace }}/artifacts/packages/native/*.zip
-
name: 'Upload native packages'
uses: actions/upload-artifact@v3
if: matrix.os != 'windows-latest'
with:
name: native-${{ runner.os }}
path: ${{ github.workspace }}/artifacts/packages/native/*.tar.gz
unit_test:
name: Unit Test code
needs: [prepare]
runs-on: ${{ matrix.os }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
targetFramework: [net48, net5.0, net6.0, netcoreapp3.1]
exclude:
-
os: 'ubuntu-latest'
targetFramework: net48
-
os: 'macos-latest'
targetFramework: net48
fail-fast: false
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Use cached cake frosting
id: cache-cake
uses: actions/[email protected]
with:
path: run
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
-
name: Use cached tools
id: cache-tools
uses: actions/[email protected]
with:
path: tools
key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }}
-
name: Setup .NET SDK
uses: actions/[email protected]
with:
dotnet-version: '7.0.x'
dotnet-quality: 'preview'
-
name: '[Unit Test]'
shell: pwsh
run: dotnet run/build.dll --target=Test --dotnet_target=${{ matrix.targetFramework }}
# -
# name: Test Summary
# uses: test-summary/action@v1
# with:
# paths: artifacts/test-results/*.results.xml
# if: always()
artifacts_windows_test:
name: Test artifacts on windows
needs: [build]
runs-on: windows-latest
strategy:
matrix:
package: [ Executable, MsBuildFull ]
fail-fast: false
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Use cached cake frosting
id: cache-cake
uses: actions/[email protected]
with:
path: run
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
-
name: Use cached tools
id: cache-tools
uses: actions/[email protected]
with:
path: tools
key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }}
-
uses: actions/download-artifact@v3
name: Download nuget packages
with:
name: nuget
path: ${{ github.workspace }}/artifacts/packages/nuget
-
name: Setup .NET SDK
uses: actions/[email protected]
with:
dotnet-version: '7.0.x'
dotnet-quality: 'preview'
-
name: '[Test Artifacts]'
shell: pwsh
run: dotnet run/artifacts.dll --target=Artifacts${{ matrix.package }}Test
artifacts_linux_test:
name: Test artifacts in docker
needs: [build]
runs-on: ubuntu-latest
strategy:
matrix:
targetFramework: [ '3.1', '5.0', '6.0' ]
distro: [ alpine.3.12, alpine.3.13, alpine.3.14, centos.7, centos.8, debian.9, debian.10, debian.11, fedora.33, ubuntu.18.04, ubuntu.20.04 ]
fail-fast: false
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Use cached cake frosting
id: cache-cake
uses: actions/[email protected]
with:
path: run
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
-
name: Use cached tools
id: cache-tools
uses: actions/[email protected]
with:
path: tools
key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }}
-
uses: actions/download-artifact@v3
name: Download nuget packages
with:
name: nuget
path: ${{ github.workspace }}/artifacts/packages/nuget
-
uses: actions/download-artifact@v3
name: Download native packages
with:
name: native-${{ runner.os }}
path: ${{ github.workspace }}/artifacts/packages/native
-
name: Setup QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
install: true
-
name: Setup .NET SDK
uses: actions/[email protected]
with:
dotnet-version: '7.0.x'
dotnet-quality: 'preview'
-
name: '[Test Artifacts (amd64)]'
shell: pwsh
run: dotnet run/artifacts.dll --target=ArtifactsTest --arch amd64 --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }}
-
name: '[Test Artifacts (arm64)]'
shell: pwsh
run: dotnet run/artifacts.dll --target=ArtifactsTest --arch arm64 --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }}
docker_linux_images:
name: Build, Test and Publish Docker Images
needs: [build]
runs-on: ubuntu-latest
strategy:
matrix:
targetFramework: [ '3.1', '5.0', '6.0' ]
distro: [ alpine.3.12, alpine.3.13, alpine.3.14, centos.7, centos.8, debian.9, debian.10, debian.11, fedora.33, ubuntu.18.04, ubuntu.20.04 ]
fail-fast: false
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Use cached cake frosting
id: cache-cake
uses: actions/[email protected]
with:
path: run
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
-
name: Use cached tools
id: cache-tools
uses: actions/[email protected]
with:
path: tools
key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }}
-
uses: actions/download-artifact@v3
name: Download nuget packages
with:
name: nuget
path: ${{ github.workspace }}/artifacts/packages/nuget
-
name: Setup QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
install: true
-
name: Setup .NET SDK
uses: actions/[email protected]
with:
dotnet-version: '7.0.x'
dotnet-quality: 'preview'
-
name: Login to DockerHub
if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: '[Docker Build/Test/Publish (amd64)] DockerHub'
if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools'
shell: pwsh
run: dotnet run/docker.dll --target=DockerPublish --arch amd64 --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} --docker_registry dockerhub
-
name: '[Docker Build/Test/Publish (arm64)] DockerHub'
if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools'
shell: pwsh
run: dotnet run/docker.dll --target=DockerPublish --arch arm64 --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} --docker_registry dockerhub
-
name: '[Docker Publish Manifest] DockerHub'
if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools'
shell: pwsh
run: dotnet run/docker.dll --target=DockerManifest --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} --docker_registry dockerhub
-
name: Login to GitHub Container Registry
if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_GITHUB_TOKEN }}
-
name: '[Docker Build/Test/Publish (amd64)] GitHub Container Registry'
if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools'
shell: pwsh
run: dotnet run/docker.dll --target=DockerPublish --arch amd64 --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} --docker_registry github
-
name: '[Docker Build/Test/Publish (arm64)] GitHub Container Registry'
if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools'
shell: pwsh
run: dotnet run/docker.dll --target=DockerPublish --arch arm64 --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} --docker_registry github
-
name: '[Docker Publish Manifest] GitHub Container Registry'
if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools'
shell: pwsh
run: dotnet run/docker.dll --target=DockerManifest --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} --docker_registry github
publish:
name: Publish
needs: [artifacts_windows_test, artifacts_linux_test, docker_linux_images]
runs-on: windows-latest
strategy:
matrix:
taskName: [NuGet, Chocolatey]
fail-fast: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Use cached cake frosting
id: cache-cake
uses: actions/[email protected]
with:
path: run
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
-
name: Use cached tools
id: cache-tools
uses: actions/[email protected]
with:
path: tools
key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }}
-
uses: actions/download-artifact@v3
name: Download nuget packages
with:
name: nuget
path: ${{ github.workspace }}/artifacts/packages/nuget
-
name: Setup .NET SDK
uses: actions/[email protected]
with:
dotnet-version: '7.0.x'
dotnet-quality: 'preview'
-
name: '[Publish]'
shell: pwsh
run: dotnet run/publish.dll --target=Publish${{ matrix.taskName }}
release:
name: Release
needs: [publish]
runs-on: windows-latest
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Use cached cake frosting
id: cache-cake
uses: actions/[email protected]
with:
path: run
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
-
name: Use cached tools
id: cache-tools
uses: actions/[email protected]
with:
path: tools
key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }}
-
uses: actions/download-artifact@v3
name: Download native linux packages
with:
name: native-Linux
path: ${{ github.workspace }}/artifacts/packages/native
-
uses: actions/download-artifact@v3
name: Download native windows packages
with:
name: native-Windows
path: ${{ github.workspace }}/artifacts/packages/native
-
uses: actions/download-artifact@v3
name: Download native macos packages
with:
name: native-macOS
path: ${{ github.workspace }}/artifacts/packages/native
-
name: Setup .NET SDK
uses: actions/[email protected]
with:
dotnet-version: '7.0.x'
dotnet-quality: 'preview'
-
name: '[Release]'
shell: pwsh
run: dotnet run/release.dll --target=PublishRelease