Skip to content

Update dependency Microsoft.NET.Test.Sdk to v18 (#284) #726

Update dependency Microsoft.NET.Test.Sdk to v18 (#284)

Update dependency Microsoft.NET.Test.Sdk to v18 (#284) #726

Workflow file for this run

name: Release
on:
push:
branches:
- master
- release-*
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-*'
pull_request:
workflow_dispatch:
env:
DOTNET_NOLOGO: true
jobs:
container:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Check for secrets
env:
SECRETS_AVAILABLE: ${{ secrets.SECRETS_AVAILABLE }}
shell: pwsh
run: exit $(If ($env:SECRETS_AVAILABLE -eq 'true') { 0 } Else { 1 })
- name: Checkout
uses: actions/checkout@v5.0.0
with:
fetch-depth: 0
- name: Setup .NET SDK
uses: actions/setup-dotnet@v5.0.0
with:
global-json-file: global.json
- name: Install MinVer CLI
run: dotnet tool install --global minver-cli
- name: Determine versions
shell: pwsh
run: |
# Read settings from Custom.Build.props
[xml]$xml = Get-Content ./src/Custom.Build.props
$minMajorMinor = $xml.selectNodes('/Project/PropertyGroup/MinVerMinimumMajorMinor').InnerText
$autoIncrement = $xml.selectNodes('/Project/PropertyGroup/MinVerAutoIncrement').InnerText
echo "MinVerMinimumMajorMinor=$minMajorMinor, MinVerAutoIncrement=$autoIncrement"
if (-not ($minMajorMinor -and $autoIncrement)) {
throw "Missing MinVer settings in Custom.Build.props"
}
# Execute MinVer
echo "MinVerVersion=$(minver --minimum-major-minor $minMajorMinor --auto-increment $autoIncrement)" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
- name: Validate build version
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
uses: ./.github/actions/validate-version
with:
version: ${{ env.MinVerVersion }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.11.1
- name: Log in to GitHub container registry
uses: docker/login-action@v3.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get current date
id: date
run: echo "date=$(date '+%FT%TZ')" >> $GITHUB_OUTPUT
- name: Build and push image to GitHub container registry
uses: docker/build-push-action@v6.18.0
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
sbom: true
labels: |
org.opencontainers.image.source=https://github.com/Particular/ServiceControl.Connector.MassTransit/tree/${{ github.sha }}
org.opencontainers.image.authors="Particular Software"
org.opencontainers.image.vendor="Particular Software"
org.opencontainers.image.url=https://hub.docker.com/r/particular/servicecontrol-masstransit-connector
org.opencontainers.image.documentation=https://hub.docker.com/r/particular/servicecontrol-masstransit-connector
org.opencontainers.image.version=${{ env.MinVerVersion }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.created=${{ steps.date.outputs.date }}
org.opencontainers.image.title=MassTransit Connector for ServiceControl
org.opencontainers.image.description=An extension to ServiceControl that adds support for processing MassTransit failures with the Particular Platform.
org.opencontainers.image.base.name=mcr.microsoft.com/dotnet/runtime:8.0-noble-chiseled
annotations: |
index:org.opencontainers.image.source=https://github.com/Particular/ServiceControl.Connector.MassTransit/tree/${{ github.sha }}
index:org.opencontainers.image.authors="Particular Software"
index:org.opencontainers.image.vendor="Particular Software"
index:org.opencontainers.image.url=https://hub.docker.com/r/particular/servicecontrol-masstransit-connector
index:org.opencontainers.image.documentation=https://hub.docker.com/r/particular/servicecontrol-masstransit-connector
index:org.opencontainers.image.version=${{ env.MinVerVersion }}
index:org.opencontainers.image.revision=${{ github.sha }}
index:org.opencontainers.image.created=${{ steps.date.outputs.date }}
index:org.opencontainers.image.title=MassTransit Connector for ServiceControl
index:org.opencontainers.image.description=An extension to ServiceControl that adds support for processing MassTransit failures with the Particular Platform.
index:org.opencontainers.image.base.name=mcr.microsoft.com/dotnet/runtime:8.0-noble-chiseled
file: src/ServiceControl.Connector.MassTransit.Host/Dockerfile
tags: ghcr.io/particular/servicecontrol-masstransit-connector:${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || env.MinVerVersion }}
- name: Deploy
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
# Does not follow standard practice of targeting explicit versions because configuration is tightly coupled to Octopus Deploy configuration
uses: Particular/push-octopus-package-action@main
with:
octopus-deploy-api-key: ${{ secrets.OCTOPUS_DEPLOY_API_KEY }}