2828 containerImageBuildContext : " src/"
2929 containerImageBuildDockerfile : " src/ES.Kubernetes.Reflector/Dockerfile"
3030 dockerHubContainerImageRepository : " emberstack"
31- ghcrContainerImageRepository : " ghcr.io/emberstack"
31+ ghcrContainerImageRepository : " ghcr.io/emberstack/container-images "
3232 helmChart : " reflector"
3333 helmChartDir : " src/helm/reflector"
3434
@@ -76,12 +76,23 @@ jobs:
7676 base : ${{ github.ref }}
7777 filters : |
7878 src:
79+ - '*.sln'
80+ - '*.slnx'
81+ - '*.props'
7982 - 'src/**'
83+ build:
84+ - '*.sln'
85+ - '*.slnx'
86+ - '*.props'
87+ - 'src/**'
88+ - 'tests/**'
89+ - 'playground/**'
90+
8091
8192 - name : evaluate - requires_build
8293 id : requires_build
8394 run : |
84- if [ "${{ steps.pathsFilter.outputs.src }}" = "true" ] || \
95+ if [ "${{ steps.pathsFilter.outputs.build }}" = "true" ] || \
8596 [ "${{ github.event.inputs.force_build }}" = "true" ] || \
8697 [ "${{ github.event.inputs.force_publish }}" = "true" ]; then
8798 result=true
@@ -125,111 +136,135 @@ jobs:
125136 - name : checkout
126137 uses : actions/checkout@v4
127138
128- - name : tools - kubectl - install
129- uses : azure/setup-kubectl@v4
130-
131- - name : tools - oras - install
132- uses : oras-project/setup-oras@v1
133-
134- - name : tools - oras - login - ghcr.io
135- if : ${{ needs.discovery.outputs.requiresBuildPush == 'true' }}
136- run : echo "${{ secrets.ES_GITHUB_PAT }}" | oras login ghcr.io -u ${{ github.actor }} --password-stdin
137-
138- - name : tools - helm - install
139- uses : azure/setup-helm@v4
140-
141- - name : tools - helm - login - ghcr.io
142- if : ${{ needs.discovery.outputs.requiresBuildPush == 'true' }}
143- run : echo "${{ secrets.ES_GITHUB_PAT }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin
139+ - name : dotnet restore
140+ if : ${{ env.build == 'true' }}
141+ run : dotnet restore
144142
145- - name : tools - docker - login ghcr.io
146- if : ${{ needs.discovery.outputs.requiresBuildPush == 'true' }}
147- uses : docker/login-action@v3
148- with :
149- registry : ghcr.io
150- username : ${{ github.actor }}
151- password : ${{ secrets.ES_GITHUB_PAT }}
152-
153- - name : tools - docker - login docker.io
154- if : ${{ needs.discovery.outputs.requiresBuildPush == 'true' }}
155- uses : docker/login-action@v3
156- with :
157- registry : docker.io
158- username : ${{ secrets.ES_DOCKERHUB_USERNAME }}
159- password : ${{ secrets.ES_DOCKERHUB_PAT }}
143+ - name : dotnet build
144+ if : ${{ env.build == 'true' }}
145+ run : dotnet build --no-restore --configuration Release /p:Version=${{env.GitVersion_SemVer}} /p:AssemblyVersion=${{env.GitVersion_AssemblySemFileVer}} /p:NuGetVersion=${{env.GitVersion_SemVer}}
160146
161- - name : tools - docker - register QEMU
162- run : |
163- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
164-
165- - name : tools - docker - setup buildx
166- uses : docker/setup-buildx-action@v3
167- with :
168- driver : docker-container # REQUIRED for multi-platform builds
169-
170- - name : artifacts - prepare directories
171- run : |
172- mkdir -p .artifacts/helm
173- mkdir -p .artifacts/kubectl
174- mkdir -p .artifacts/artifacthub
175-
176- - name : helm - import README
177- run : cp README.md ${{ env.helmChartDir }}/README.md
178-
179- - name : helm - package chart
180- run : helm package --destination .artifacts/helm --version ${{ env.gitVersion_SemVer }} --app-version ${{ env.gitVersion_SemVer }} ${{ env.helmChartDir }}
181-
182- - name : helm - template chart
183- run : helm template --namespace kube-system ${{ env.helmChart }} .artifacts/helm/${{ env.helmChart }}-${{ env.gitVersion_SemVer }}.tgz > .artifacts/kubectl/${{ env.helmChart }}.yaml
184-
185- - name : helm - artifacthub - repo
186- run : install -D src/helm/artifacthub-repo.yaml .artifacts/artifacthub/artifacthub-repo.yaml
187-
188- - name : docker - build and push
189- uses : docker/build-push-action@v6
190- with :
191- context : ${{ env.containerImageBuildContext }}
192- file : ${{ env.containerImageBuildDockerfile }}
193- push : ${{ needs.discovery.outputs.requiresBuildPush == 'true' }}
194- provenance : false
195- platforms : linux/amd64,linux/arm/v7,linux/arm64
196- labels : |
197- org.opencontainers.image.source=https://github.com/${{ github.repository }}
198- org.opencontainers.image.url=https://github.com/${{ github.repository }}
199- org.opencontainers.image.vendor=${{ github.repository_owner }}
200- org.opencontainers.image.version=${{ env.gitVersion_SemVer }}
201- org.opencontainers.image.revision=${{ github.sha }}
202- tags : |
203- ${{ env.dockerHubContainerImageRepository }}/${{ env.containerImage }}:${{ env.gitVersion_SemVer }}
204- ${{ env.ghcrContainerImageRepository }}/${{ env.containerImage }}:${{ env.gitVersion_SemVer }}
205-
206- - name : helm - push - ghcr.io
207- run : helm push .artifacts/helm/${{ env.helmChart }}-${{ env.gitVersion_SemVer }}.tgz oci://ghcr.io/${{ github.repository_owner }}/helm-charts
208-
209- - name : docker - tag and push - latest
210- if : ${{ needs.discovery.outputs.requiresRelease == 'true' }}
211- run : |
212- docker buildx imagetools create \
213- --tag ${{ env.dockerHubContainerImageRepository }}/${{ env.containerImage }}:latest \
214- --tag ${{ env.ghcrContainerImageRepository }}/${{ env.containerImage }}:latest \
215- ${{ env.ghcrContainerImageRepository }}/${{ env.containerImage }}:${{ env.gitVersion_SemVer }}
216-
217- - name : oras - push - artifact hub metadata
218- if : ${{ needs.discovery.outputs.requiresRelease == 'true' }}
219- run : |
220- oras push ghcr.io/${{ github.repository_owner }}/helm-charts/${{ env.helmChart }}:artifacthub.io \
221- --config /dev/null:application/vnd.cncf.artifacthub.config.v1+yaml \
222- .artifacts/artifacthub/artifacthub-repo.yaml:application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml
147+ - name : dotnet test
148+ if : ${{ env.build == 'true' }}
149+ run : dotnet test --no-build --configuration Release --verbosity normal
223150
224- - name : github - release - create
225- if : ${{ needs.discovery.outputs.requiresRelease == 'true' }}
226- uses : softprops/action-gh-release@v2
151+ - name : test-reporter
152+ uses : dorny/test-reporter@v2
153+ if : ${{ env.build == 'true' && github.event.pull_request.head.repo.fork == false }}
227154 with :
228- repository : ${{ github.repository }}
229- name : v${{ env.gitVersion_SemVer }}
230- tag_name : v${{ env.gitVersion_SemVer }}
231- body : The release process is automated.
232- generate_release_notes : true
233- token : ${{ secrets.ES_GITHUB_PAT }}
234- files : |
235- .artifacts/kubectl/${{ env.helmChart }}.yaml
155+ name : Test Results
156+ path : .artifacts/TestResults/*.trx
157+ reporter : dotnet-trx
158+
159+
160+
161+ # - name: tools - kubectl - install
162+ # uses: azure/setup-kubectl@v4
163+
164+ # - name: tools - oras - install
165+ # uses: oras-project/setup-oras@v1
166+
167+ # - name: tools - oras - login - ghcr.io
168+ # if: ${{ needs.discovery.outputs.requiresBuildPush == 'true' }}
169+ # run: echo "${{ secrets.ES_GITHUB_PAT }}" | oras login ghcr.io -u ${{ github.actor }} --password-stdin
170+
171+ # - name: tools - helm - install
172+ # uses: azure/setup-helm@v4
173+
174+ # - name: tools - helm - login - ghcr.io
175+ # if: ${{ needs.discovery.outputs.requiresBuildPush == 'true' }}
176+ # run: echo "${{ secrets.ES_GITHUB_PAT }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin
177+
178+ # - name: tools - docker - login ghcr.io
179+ # if: ${{ needs.discovery.outputs.requiresBuildPush == 'true' }}
180+ # uses: docker/login-action@v3
181+ # with:
182+ # registry: ghcr.io
183+ # username: ${{ github.actor }}
184+ # password: ${{ secrets.ES_GITHUB_PAT }}
185+
186+ # - name: tools - docker - login docker.io
187+ # if: ${{ needs.discovery.outputs.requiresBuildPush == 'true' }}
188+ # uses: docker/login-action@v3
189+ # with:
190+ # registry: docker.io
191+ # username: ${{ secrets.ES_DOCKERHUB_USERNAME }}
192+ # password: ${{ secrets.ES_DOCKERHUB_PAT }}
193+
194+ # - name: tools - docker - register QEMU
195+ # run: |
196+ # docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
197+
198+ # - name: tools - docker - setup buildx
199+ # uses: docker/setup-buildx-action@v3
200+ # with:
201+ # driver: docker-container # REQUIRED for multi-platform builds
202+
203+ # - name: artifacts - prepare directories
204+ # run: |
205+ # mkdir -p .artifacts/helm
206+ # mkdir -p .artifacts/kubectl
207+ # mkdir -p .artifacts/artifacthub
208+
209+ # - name: helm - import README
210+ # run: cp README.md ${{ env.helmChartDir }}/README.md
211+
212+ # - name: helm - package chart
213+ # run: helm package --destination .artifacts/helm --version ${{ env.gitVersion_SemVer }} --app-version ${{ env.gitVersion_SemVer }} ${{ env.helmChartDir }}
214+
215+ # - name: helm - template chart
216+ # run: helm template --namespace kube-system ${{ env.helmChart }} .artifacts/helm/${{ env.helmChart }}-${{ env.gitVersion_SemVer }}.tgz > .artifacts/kubectl/${{ env.helmChart }}.yaml
217+
218+ # - name: helm - artifacthub - repo
219+ # run: install -D src/helm/artifacthub-repo.yaml .artifacts/artifacthub/artifacthub-repo.yaml
220+
221+ # - name: docker - build and push
222+ # uses: docker/build-push-action@v6
223+ # with:
224+ # context: ${{ env.containerImageBuildContext }}
225+ # file: ${{ env.containerImageBuildDockerfile }}
226+ # push: ${{ needs.discovery.outputs.requiresBuildPush == 'true' }}
227+ # provenance: false
228+ # platforms: linux/amd64,linux/arm/v7,linux/arm64
229+ # labels: |
230+ # org.opencontainers.image.source=https://github.com/${{ github.repository }}
231+ # org.opencontainers.image.url=https://github.com/${{ github.repository }}
232+ # org.opencontainers.image.vendor=${{ github.repository_owner }}
233+ # org.opencontainers.image.version=${{ env.gitVersion_SemVer }}
234+ # org.opencontainers.image.revision=${{ github.sha }}
235+ # tags: |
236+ # ${{ env.dockerHubContainerImageRepository }}/${{ env.containerImage }}:build-${{ env.gitVersion_SemVer }}
237+ # ${{ env.ghcrContainerImageRepository }}/${{ env.containerImage }}:build-${{ env.gitVersion_SemVer }}
238+
239+ # - name: helm - push - ghcr.io
240+ # run: helm push .artifacts/helm/${{ env.helmChart }}-${{ env.gitVersion_SemVer }}.tgz oci://ghcr.io/${{ github.repository_owner }}/helm-charts
241+
242+ # - name: oras - push - artifact hub metadata
243+ # if: ${{ needs.discovery.outputs.requiresRelease == 'true' }}
244+ # run: |
245+ # oras push ghcr.io/${{ github.repository_owner }}/helm-charts/${{ env.helmChart }}:artifacthub.io \
246+ # --config /dev/null:application/vnd.cncf.artifacthub.config.v1+yaml \
247+ # .artifacts/artifacthub/artifacthub-repo.yaml:application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml
248+
249+ # - name: docker - tag and push - latest
250+ # if: ${{ needs.discovery.outputs.requiresRelease == 'true' }}
251+ # run: |
252+ # docker buildx imagetools create \
253+ # --tag ${{ env.dockerHubContainerImageRepository }}/${{ env.containerImage }}:latest \
254+ # --tag ${{ env.ghcrContainerImageRepository }}/${{ env.containerImage }}:latest \
255+ # ${{ env.ghcrContainerImageRepository }}/${{ env.containerImage }}:${{ env.gitVersion_SemVer }}
256+
257+
258+
259+ # - name: github - release - create
260+ # if: ${{ needs.discovery.outputs.requiresRelease == 'true' }}
261+ # uses: softprops/action-gh-release@v2
262+ # with:
263+ # repository: ${{ github.repository }}
264+ # name: v${{ env.gitVersion_SemVer }}
265+ # tag_name: v${{ env.gitVersion_SemVer }}
266+ # body: The release process is automated.
267+ # generate_release_notes: true
268+ # token: ${{ secrets.ES_GITHUB_PAT }}
269+ # files: |
270+ # .artifacts/kubectl/${{ env.helmChart }}.yaml
0 commit comments