-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from arturcic/main
CI workflows refactoring
- Loading branch information
Showing
19 changed files
with
562 additions
and
347 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: 'Build Deps Manifest' | ||
description: 'Docker Build Deps Images Manifest' | ||
inputs: | ||
docker_distro: | ||
description: 'Linux Distro' | ||
required: true | ||
docker_registry: | ||
description: 'Docker Registry' | ||
required: true | ||
docker_registry_name: | ||
description: 'Docker Registry Name' | ||
required: true | ||
docker_registry_username: | ||
description: 'Docker Registry Username' | ||
required: true | ||
docker_registry_password: | ||
description: 'Docker Registry Password' | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Login to ${{ inputs.docker_registry }} | ||
if: ${{ env.PUSH_IMAGES == 'true' }} | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ inputs.docker_registry }} | ||
username: ${{ inputs.docker_registry_username }} | ||
password: ${{ inputs.docker_registry_password }} | ||
- name: '[Build Docker Deps manifest] ${{ inputs.docker_registry }}' | ||
shell: pwsh | ||
run: | | ||
dotnet run/build.dll ` | ||
--target=DockerBuildDepsManifest ` | ||
--docker_distro=${{ inputs.docker_distro }} --docker_registry=${{ inputs.docker_registry_name }} ` | ||
--push_images=${{ env.PUSH_IMAGES }} --verbosity=diagnostic |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: 'Build Deps' | ||
description: 'Docker Build Deps Images' | ||
inputs: | ||
arch: | ||
description: 'OS architecture' | ||
required: true | ||
docker_distro: | ||
description: 'Linux Distro' | ||
required: true | ||
docker_registry: | ||
description: 'Docker Registry' | ||
required: true | ||
docker_registry_name: | ||
description: 'Docker Registry Name' | ||
required: true | ||
docker_registry_username: | ||
description: 'Docker Registry Username' | ||
required: true | ||
docker_registry_password: | ||
description: 'Docker Registry Password' | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Login to ${{ inputs.docker_registry }} | ||
if: ${{ env.PUSH_IMAGES == 'true' }} | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ inputs.docker_registry }} | ||
username: ${{ inputs.docker_registry_username }} | ||
password: ${{ inputs.docker_registry_password }} | ||
- name: '[Build Docker Deps] ${{ inputs.docker_registry }}' | ||
shell: pwsh | ||
run: | | ||
dotnet run/build.dll ` | ||
--target=DockerBuildDeps --arch=${{ inputs.arch }} ` | ||
--docker_distro=${{ inputs.docker_distro }} --docker_registry=${{ inputs.docker_registry_name }} ` | ||
--push_images=${{ env.PUSH_IMAGES }} --verbosity=diagnostic |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: 'Build Images Manifest' | ||
description: 'Docker Build Images Manifest' | ||
inputs: | ||
dotnet_version: | ||
description: '.net version' | ||
required: true | ||
dotnet_variant: | ||
description: '.net variant' | ||
required: true | ||
docker_distro: | ||
description: 'Linux Distro' | ||
required: true | ||
docker_registry: | ||
description: 'Docker Registry' | ||
required: true | ||
docker_registry_name: | ||
description: 'Docker Registry Name' | ||
required: true | ||
docker_registry_username: | ||
description: 'Docker Registry Username' | ||
required: true | ||
docker_registry_password: | ||
description: 'Docker Registry Password' | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Login to ${{ inputs.docker_registry }} | ||
if: ${{ env.PUSH_IMAGES == 'true' }} | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ inputs.docker_registry }} | ||
username: ${{ inputs.docker_registry_username }} | ||
password: ${{ inputs.docker_registry_password }} | ||
- name: '[Build Docker images manifest] ${{ inputs.docker_registry }}' | ||
shell: pwsh | ||
run: | | ||
dotnet run/build.dll ` | ||
--target=DockerBuildImagesManifest ` | ||
--dotnet_version=${{ inputs.dotnet_version }} --dotnet_variant=${{ inputs.dotnet_variant }} ` | ||
--docker_distro=${{ inputs.docker_distro }} --docker_registry=${{ inputs.docker_registry_name }} ` | ||
--push_images=${{ env.PUSH_IMAGES }} --verbosity=diagnostic |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: 'Build Images' | ||
description: 'Docker Build Images' | ||
inputs: | ||
arch: | ||
description: 'OS architecture' | ||
required: true | ||
dotnet_version: | ||
description: '.net version' | ||
required: true | ||
dotnet_variant: | ||
description: '.net variant' | ||
required: true | ||
docker_distro: | ||
description: 'Linux Distro' | ||
required: true | ||
docker_registry: | ||
description: 'Docker Registry' | ||
required: true | ||
docker_registry_name: | ||
description: 'Docker Registry Name' | ||
required: true | ||
docker_registry_username: | ||
description: 'Docker Registry Username' | ||
required: true | ||
docker_registry_password: | ||
description: 'Docker Registry Password' | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Login to ${{ inputs.docker_registry }} | ||
if: ${{ env.PUSH_IMAGES == 'true' }} | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ inputs.docker_registry }} | ||
username: ${{ inputs.docker_registry_username }} | ||
password: ${{ inputs.docker_registry_password }} | ||
- name: '[Build Docker images] ${{ inputs.docker_registry }}' | ||
shell: pwsh | ||
run: | | ||
dotnet run/build.dll ` | ||
--target=DockerBuildImages --arch=${{ inputs.arch }} ` | ||
--dotnet_version=${{ inputs.dotnet_version }} --dotnet_variant=${{ inputs.dotnet_variant }} ` | ||
--docker_distro=${{ inputs.docker_distro }} --docker_registry=${{ inputs.docker_registry_name }} ` | ||
--push_images=${{ env.PUSH_IMAGES }} --verbosity=diagnostic |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: 'Docker Setup' | ||
description: 'Setups the docker engine' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Set up Docker | ||
uses: docker/setup-docker-action@v4 | ||
with: | ||
daemon-config: '{ "features": { "containerd-snapshotter": true } }' | ||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
version: 'latest' | ||
driver-opts: 'image=moby/buildkit:buildx-stable-1' | ||
install: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: dotnet-sdk | ||
labels: | ||
- "dependencies" | ||
commit-message: | ||
prefix: "(deps)" | ||
directory: "/build" | ||
schedule: | ||
interval: daily | ||
- package-ecosystem: nuget | ||
labels: | ||
- "dependencies" | ||
commit-message: | ||
prefix: "(deps)" | ||
directory: "/build" | ||
schedule: | ||
interval: daily | ||
open-pull-requests-limit: 10 | ||
- package-ecosystem: github-actions | ||
labels: | ||
- "dependencies" | ||
commit-message: | ||
prefix: "(build deps)" | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
- package-ecosystem: dotnet-sdk | ||
labels: | ||
- "dependencies" | ||
commit-message: | ||
prefix: "(deps)" | ||
directory: "/build" | ||
schedule: | ||
interval: daily | ||
- package-ecosystem: nuget | ||
labels: | ||
- "dependencies" | ||
commit-message: | ||
prefix: "(deps)" | ||
directory: "/build" | ||
schedule: | ||
interval: daily | ||
open-pull-requests-limit: 10 | ||
- package-ecosystem: github-actions | ||
labels: | ||
- "dependencies" | ||
commit-message: | ||
prefix: "(build deps)" | ||
directory: "/" | ||
schedule: | ||
interval: daily |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
pull_request_rules: | ||
- name: Automatic approve on dependabot PR | ||
conditions: | ||
- author~=^dependabot(|-preview)\[bot\]$ | ||
actions: | ||
review: | ||
type: APPROVE | ||
- name: Automatic merge on dependabot PR after success CI | ||
conditions: | ||
- author~=^dependabot(|-preview)\[bot\]$ | ||
- '#commits-behind=0' # Only merge up to date pull requests | ||
- repository-full-name=GitTools/build-images # Don't auto-merge PRs in forks | ||
actions: | ||
merge: | ||
- name: Thank contributor | ||
conditions: | ||
- merged | ||
- -author~=^dependabot(|-preview)\[bot\]$ | ||
actions: | ||
comment: | ||
message: "Thank you @{{author}} for your contribution!" | ||
- name: Automatic approve on dependabot PR | ||
conditions: | ||
- author~=^dependabot(|-preview)\[bot\]$ | ||
actions: | ||
review: | ||
type: APPROVE | ||
- name: Automatic merge on dependabot PR after success CI | ||
conditions: | ||
- author~=^dependabot(|-preview)\[bot\]$ | ||
- '#commits-behind=0' # Only merge up to date pull requests | ||
- repository-full-name=GitTools/build-images # Don't auto-merge PRs in forks | ||
actions: | ||
merge: | ||
- name: Thank contributor | ||
conditions: | ||
- merged | ||
- -author~=^dependabot(|-preview)\[bot\]$ | ||
actions: | ||
comment: | ||
message: "Thank you @{{author}} for your contribution!" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
docker_distros: | ||
required: true | ||
type: string | ||
env: | ||
DOTNET_INSTALL_DIR: "./.dotnet" | ||
DOTNET_ROLL_FORWARD: "Major" | ||
PUSH_IMAGES: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GitTools' }} | ||
|
||
jobs: | ||
build_deps_manifests: | ||
name: ${{ matrix.docker_distro }} | ||
runs-on: ubuntu-24.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
docker_distro: ${{ fromJson(inputs.docker_distros) }} | ||
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 .NET SDK | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
global-json-file: build/global.json | ||
- name: Set up Docker | ||
uses: ./.github/actions/docker-setup | ||
- name: Publish image manifest to DockerHub | ||
uses: ./.github/actions/build-deps-manifest | ||
with: | ||
docker_distro: ${{ matrix.docker_distro }} | ||
docker_registry: docker.io | ||
docker_registry_name: dockerhub | ||
docker_registry_username: ${{ secrets.DOCKER_USERNAME }} | ||
docker_registry_password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Publish image manifest to GitHub | ||
uses: ./.github/actions/build-deps-manifest | ||
with: | ||
docker_distro: ${{ matrix.docker_distro }} | ||
docker_registry: ghcr.io | ||
docker_registry_name: github | ||
docker_registry_username: ${{ github.repository_owner }} | ||
docker_registry_password: ${{ secrets.DOCKER_GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
runner: | ||
required: true | ||
type: string | ||
arch: | ||
required: true | ||
type: string | ||
docker_distros: | ||
required: true | ||
type: string | ||
env: | ||
DOTNET_INSTALL_DIR: "./.dotnet" | ||
DOTNET_ROLL_FORWARD: "Major" | ||
PUSH_IMAGES: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GitTools' }} | ||
|
||
jobs: | ||
build_deps: | ||
name: ${{ matrix.docker_distro }} | ||
runs-on: ${{ inputs.runner }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
docker_distro: ${{ fromJson(inputs.docker_distros) }} | ||
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 .NET SDK | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
global-json-file: build/global.json | ||
- name: Set up Docker | ||
uses: ./.github/actions/docker-setup | ||
- name: Publish image to DockerHub | ||
uses: ./.github/actions/build-deps | ||
with: | ||
arch: ${{ inputs.arch }} | ||
docker_distro: ${{ matrix.docker_distro }} | ||
docker_registry: docker.io | ||
docker_registry_name: dockerhub | ||
docker_registry_username: ${{ secrets.DOCKER_USERNAME }} | ||
docker_registry_password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Publish image to GitHub | ||
uses: ./.github/actions/build-deps | ||
with: | ||
arch: ${{ inputs.arch }} | ||
docker_distro: ${{ matrix.docker_distro }} | ||
docker_registry: ghcr.io | ||
docker_registry_name: github | ||
docker_registry_username: ${{ github.repository_owner }} | ||
docker_registry_password: ${{ secrets.DOCKER_GITHUB_TOKEN }} |
Oops, something went wrong.