Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Build artifacts
**/bin/
**/obj/
**/out/

# Visual Studio
.vs/
*.user
*.suo
*.userosscache
*.sln.docstates

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/

# NuGet Packages
*.nupkg
*.snupkg
.nuget/
**/packages/*

# Test Results
TestResults/
*.trx
*.coverage
*.coveragexml

# Git
.git/
.gitignore
.gitattributes

# GitHub
.github/

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# Documentation - exclude most but keep README.md needed for build
!README.md
docs/
*.md
!README.md

# CI/CD
azure-pipelines.yml
.azure/

# Misc
LICENSE
.editorconfig
.dockerignore
58 changes: 57 additions & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,60 @@ jobs:
- name: Publish to GitHub Packages
run: gh release upload ${{ github.ref_name }} lib/bin/Release/*.nupkg lib/bin/Release/*.snupkg tool/bin/Release/*.nupkg tool/bin/Release/*.snupkg --repo ${{ github.repository }} --clobber
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docker-build:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please split the build and the publish jobs? to align with the nuget publish

runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
attestations: write

steps:
- uses: actions/checkout@v6

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think something is wrong with how the tags are set here, see the failing CI

type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha,prefix=sha-{{branch}}
type=raw,value=latest,enable={{is_default_branch}}

- name: Build Docker image
id: build
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Generate artifact attestation
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: actions/attest-build-provenance@v1
with:
subject-name: ghcr.io/${{ github.repository }}
subject-digest: ${{ steps.build.outputs.digest }}
push-to-registry: true
Loading