Skip to content

Bump AzurePipelinesToGitHubActionsConverter.Core from 1.4.3 to 1.4.5 #824

Bump AzurePipelinesToGitHubActionsConverter.Core from 1.4.3 to 1.4.5

Bump AzurePipelinesToGitHubActionsConverter.Core from 1.4.3 to 1.4.5 #824

Workflow file for this run

name: "Pipelines to Actions website CI/CD"
on: [push]
jobs:
build:
runs-on: windows-latest
outputs: # https://stackoverflow.com/questions/59175332/using-output-from-a-previous-job-in-a-new-one-in-a-github-action
Version: ${{ steps.gitversion.outputs.MajorMinorPatch }}
CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 #fetch-depth is needed for GitVersion
- name: Install GitVersion #Install and calculate the new version with GitVersion
uses: gittools/actions/gitversion/setup@v4.2.0
with:
versionSpec: 6.x
- name: Determine Version
uses: gittools/actions/gitversion/execute@v4.2.0
id: gitversion # step id used as reference for output values
- name: Display GitVersion outputs
run: |
echo "Version: ${{ steps.gitversion.outputs.MajorMinorPatch }}"
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}"
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Run automated unit and integration tests
run: dotnet test PipelinesToActions/PipelinesToActions.Tests/PipelinesToActions.Tests.csproj --configuration Debug -e:CollectCoverage=true -e:CoverletOutput=TestResults/ -e:CoverletOutputFormat=lcov
- run: |
dir PipelinesToActions/PipelinesToActions.Tests/TestResults
type PipelinesToActions/PipelinesToActions.Tests/TestResults/coverage.info
- name: Publish coverage report to coveralls.io
uses: coverallsapp/github-action@v2.3.7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: PipelinesToActions/PipelinesToActions.Tests/TestResults/coverage.info
#Publish dotnet objects
- name: .NET Publish Web Site
run: dotnet publish PipelinesToActions/PipelinesToActions/PipelinesToActionsWeb.csproj --configuration Release -p:Version='${{ steps.gitversion.outputs.MajorMinorPatch }}'
#Publish build artifacts to GitHub
- name: Upload website build artifacts back to GitHub
uses: actions/upload-artifact@v6
with:
name: webapp
path: PipelinesToActions/PipelinesToActions/bin/Release/net10.0/publish
sonarCloud:
name: Run SonarCloud analysis
runs-on: ubuntu-latest
if: false && github.ref == 'refs/heads/main'
steps:
- name: Run Sonarcloud test
uses: samsmithnz/SamsDotNetSonarCloudAction@v2.1
with:
projects: 'PipelinesToActions/PipelinesToActions/PipelinesToActionsWeb.csproj,PipelinesToActions/PipelinesToActions.Tests/PipelinesToActions.Tests.csproj'
dotnet-version: '10.0.x'
sonarcloud-organization: samsmithnz-github
sonarcloud-project: samsmithnz_AzurePipelinesToGitHubActionsConverterWeb
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
#Deploy the artifacts to Azure
deploy:
runs-on: windows-latest
needs:
- build
#- sonarCloud
#Only deploy if running off the main branch - we don't want to deploy off feature branches
if: github.ref == 'refs/heads/main'
steps:
- name: Display GitVersion outputs
run: |
echo "Version: ${{ needs.build.outputs.Version }}"
echo "CommitsSinceVersionSource: ${{ needs.build.outputs.CommitsSinceVersionSource }}"
- name: Log into Azure # Login with the secret SP details
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_SP }}
- name: Download webapp artifact #Download the artifacts from GitHub
uses: actions/download-artifact@v7
with:
name: webapp
path: webapp
- name: Deploy web service to Azure WebApp #Deploy service and website to Azure staging slots
uses: Azure/webapps-deploy@v3
with:
app-name: PipelinesToActions
package: webapp
slot-name: production
clean: true
- name: Create Release
id: create_release
uses: actions/create-release@v1
if: needs.build.outputs.CommitsSinceVersionSource > 0 #Only create a release if there has been a commit/version change
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: "v${{ needs.build.outputs.Version }}"
release_name: "v${{ needs.build.outputs.Version }}"