Build #495
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: [ Build Deps ] | |
types: | |
- completed | |
jobs: | |
prepare: | |
name: Prepare Build | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Cache cake frosting | |
id: cache-cake | |
uses: actions/cache@v4 | |
with: | |
path: run | |
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} | |
- | |
name: Setup .NET SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
- | |
name: '[Prepare]' | |
if: steps.cache-cake.outputs.cache-hit != 'true' | |
run: dotnet build build/CI.sln --configuration=Release | |
build: | |
name: Build | |
needs: [prepare] | |
env: | |
PUSH_IMAGES: ${{github.event_name != 'pull_request' && github.repository_owner == 'GitTools'}} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
variant: [runtime, sdk] | |
version: ['8.0', '7.0', '6.0'] | |
distro: [alpine.3.17, alpine.3.18, centos.stream.8, debian.11, fedora.37, ubuntu.20.04, ubuntu.22.04] | |
fail-fast: false | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Use cached cake frosting | |
id: cache-cake | |
uses: actions/cache@v4 | |
with: | |
path: run | |
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} | |
- | |
name: Setup QEMU | |
uses: docker/setup-qemu-action@v3 | |
- | |
name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
install: true | |
- | |
name: Setup .NET SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
- | |
name: Login to DockerHub | |
if: success() && env.PUSH_IMAGES == 'true' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- | |
name: '[Build Docker images]' | |
shell: pwsh | |
run: | | |
dotnet run/build.dll --target=DockerBuild --dotnet_version=${{ matrix.version }} --dotnet_variant=${{ matrix.variant }} ` | |
--dotnet_distro=${{ matrix.distro }} --docker_registry=dockerhub ` | |
--push_images=${{env.PUSH_IMAGES}} | |
- | |
name: Login to GitHub Container Registry | |
if: success() && env.PUSH_IMAGES == 'true' | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.DOCKER_GITHUB_TOKEN }} | |
- | |
name: '[Build Docker images]' | |
shell: pwsh | |
run: | | |
dotnet run/build.dll --target=DockerBuild --dotnet_version=${{ matrix.version }} --dotnet_variant=${{ matrix.variant }} ` | |
--dotnet_distro=${{ matrix.distro }} --docker_registry=github ` | |
--push_images=${{env.PUSH_IMAGES}} |