Update sonarcloud.yml #43
Workflow file for this run
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: .NET | |
env: | |
PRERELEASE_BRANCHES: experimental,alpha,beta,rc | |
DOCKER_HUB_REPO: ${{ secrets.RAAEDGE_LOGIN_SERVER }}/connectors-opcua | |
COVERAGE_FOLDER: Coverage | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
types: [ closed ] | |
jobs: | |
ci: | |
name: Integration | |
runs-on: ubuntu-latest | |
outputs: | |
should-publish: ${{ steps.context.outputs.should-publish }} | |
current-version: ${{ steps.context.outputs.current-version }} | |
release-type: ${{ steps.context.outputs.release-type }} | |
cascading-release: ${{ steps.context.outputs.cascading-release }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '7.0.x' | |
- name: Install dependencies | |
run: dotnet restore --no-cache --verbosity normal | |
- name: Build | |
run: dotnet build --no-restore --configuration Release | |
- name: Test | |
run: dotnet test --configuration Release --no-build | |
- name: 'Azure login' | |
uses: azure/docker-login@v1 | |
with: | |
login-server: ${{ secrets.RAAEDGE_LOGIN_SERVER }} | |
username: ${{ secrets.RAAEDGE_ACR_USERNAME }} | |
password: ${{ secrets.RAAEDGE_ACR_PASSWORD }} | |
- name: Establish context | |
id: context | |
uses: dolittle/establish-context-action@v2 | |
with: | |
prerelease-branches: ${{ env.PRERELEASE_BRANCHES }} | |
- name: Docker Build | |
if: ${{ steps.context.outputs.should-publish == 'false' }} | |
shell: bash | |
run: | | |
docker build --no-cache -f $GITHUB_WORKSPACE/Source/Dockerfile -t ${{ env.DOCKER_HUB_REPO }}:${{ github.sha }} . | |
- name: Increment version | |
id: increment-version | |
if: ${{ steps.context.outputs.should-publish == 'true' }} | |
uses: dolittle/increment-version-action@v2 | |
with: | |
version: ${{ steps.context.outputs.current-version }} | |
release-type: ${{ steps.context.outputs.release-type }} | |
- name: Docker push | |
if: ${{ steps.context.outputs.should-publish == 'true' && env.DOCKER_HUB_REPO != '' }} | |
run: | | |
docker build --no-cache -f $GITHUB_WORKSPACE/Source/Dockerfile -t ${{ env.DOCKER_HUB_REPO }}:${{ steps.increment-version.outputs.next-version }} -t ${{ env.DOCKER_HUB_REPO }}:latest . | |
docker push ${{ env.DOCKER_HUB_REPO }}:${{ steps.increment-version.outputs.next-version }} | |
docker push ${{ env.DOCKER_HUB_REPO }}:latest | |
- name: Create GitHub Release | |
uses: dolittle/github-release-action@v2 | |
if: ${{ steps.context.outputs.should-publish == 'true' }} | |
with: | |
cascading-release: ${{ steps.context.outputs.cascading-release }} | |
version: ${{ steps.increment-version.outputs.next-version }} | |
body: ${{ steps.context.outputs.pr-body }} |