Resolves #104 and #105 (#112) #184
This file contains hidden or 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: release | |
| on: | |
| push: | |
| branches: | |
| - releases/** | |
| - hotfix/** | |
| - develop | |
| - main | |
| paths: | |
| - src/** | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET 6.0 | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: 6.0.x | |
| - name: Setup .NET 7.0 | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: 7.0.x | |
| - name: Setup .NET 8.0 | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Setup .NET Core 3.1 | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: 3.1.x | |
| - name: Install GitVersion | |
| uses: gittools/actions/gitversion/setup@v0.9.11 | |
| with: | |
| versionSpec: '5.x' | |
| - name: Install dependencies | |
| run: dotnet restore ./src/AzureMapsControl.Components/AzureMapsControl.Components.csproj | |
| - name: Build | |
| run: dotnet build --configuration Release --no-restore ./src/AzureMapsControl.Components/AzureMapsControl.Components.csproj | |
| - name: Test | |
| run: dotnet test ./tests/AzureMapsControl.Components.Tests/AzureMapsControl.Components.Tests.csproj | |
| - name: NPM Install | |
| run: cd ./src/AzureMapsControl.Components && npm i | |
| - name: Lint | |
| run: cd ./src/AzureMapsControl.Components && npm run lint | |
| - name: Build Typescript | |
| run: cd ./src/AzureMapsControl.Components && npm run build | |
| - name: Use GitVersion | |
| id: gitversion # step id used as reference for output values | |
| uses: gittools/actions/gitversion/execute@v0.9.11 | |
| - run: | | |
| echo "Major: ${{ steps.gitversion.outputs.major }}" | |
| echo "Minor: ${{ steps.gitversion.outputs.minor }}" | |
| echo "Patch: ${{ steps.gitversion.outputs.patch }}" | |
| echo "PreReleaseTag: ${{ steps.gitversion.outputs.preReleaseTag }}" | |
| echo "PreReleaseTagWithDash: ${{ steps.gitversion.outputs.preReleaseTagWithDash }}" | |
| echo "PreReleaseLabel: ${{ steps.gitversion.outputs.preReleaseLabel }}" | |
| echo "PreReleaseNumber: ${{ steps.gitversion.outputs.preReleaseNumber }}" | |
| echo "WeightedPreReleaseNumber: ${{ steps.gitversion.outputs.weightedPreReleaseNumber }}" | |
| echo "BuildMetaData: ${{ steps.gitversion.outputs.buildMetaData }}" | |
| echo "BuildMetaDataPadded: ${{ steps.gitversion.outputs.buildMetaDataPadded }}" | |
| echo "FullBuildMetaData: ${{ steps.gitversion.outputs.fullBuildMetaData }}" | |
| echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}" | |
| echo "SemVer: ${{ steps.gitversion.outputs.semVer }}" | |
| echo "LegacySemVer: ${{ steps.gitversion.outputs.legacySemVer }}" | |
| echo "LegacySemVerPadded: ${{ steps.gitversion.outputs.legacySemVerPadded }}" | |
| echo "AssemblySemVer: ${{ steps.gitversion.outputs.assemblySemVer }}" | |
| echo "AssemblySemFileVer: ${{ steps.gitversion.outputs.assemblySemFileVer }}" | |
| echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}" | |
| echo "InformationalVersion: ${{ steps.gitversion.outputs.informationalVersion }}" | |
| echo "BranchName: ${{ steps.gitversion.outputs.branchName }}" | |
| echo "Sha: ${{ steps.gitversion.outputs.sha }}" | |
| echo "ShortSha: ${{ steps.gitversion.outputs.shortSha }}" | |
| echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}" | |
| echo "NuGetVersion: ${{ steps.gitversion.outputs.nuGetVersion }}" | |
| echo "NuGetPreReleaseTagV2: ${{ steps.gitversion.outputs.nuGetPreReleaseTagV2 }}" | |
| echo "NuGetPreReleaseTag: ${{ steps.gitversion.outputs.nuGetPreReleaseTag }}" | |
| echo "VersionSourceSha: ${{ steps.gitversion.outputs.versionSourceSha }}" | |
| echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.commitsSinceVersionSource }}" | |
| echo "CommitsSinceVersionSourcePadded: ${{ steps.gitversion.outputs.commitsSinceVersionSourcePadded }}" | |
| echo "CommitDate: ${{ steps.gitversion.outputs.commitDate }}" | |
| - name: Tag Repo Prerelease | |
| if: ${{ steps.gitversion.outputs.branchName != 'master' && steps.gitversion.outputs.branchName != 'main' }} | |
| uses: richardsimko/update-tag@v1 | |
| with: | |
| tag_name: ${{ steps.gitversion.outputs.nuGetVersionV2 }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Tag Repo | |
| if: ${{ steps.gitversion.outputs.branchName == 'master' || steps.gitversion.outputs.branchName == 'main' }} | |
| uses: richardsimko/update-tag@v1 | |
| with: | |
| tag_name: ${{ steps.gitversion.outputs.majorMinorPatch }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Pack PreRelease | |
| if: ${{ steps.gitversion.outputs.branchName != 'master' && steps.gitversion.outputs.branchName != 'main' }} | |
| run: dotnet pack ./src/AzureMapsControl.Components/AzureMapsControl.Components.csproj -p:Version='${{ steps.gitversion.outputs.nuGetVersionV2 }}"' -c Release --no-build | |
| - name: Pack | |
| if: ${{ steps.gitversion.outputs.branchName == 'master' || steps.gitversion.outputs.branchName == 'main' }} | |
| run: dotnet pack ./src/AzureMapsControl.Components/AzureMapsControl.Components.csproj -p:Version='${{ steps.gitversion.outputs.majorMinorPatch }}"' -c Release --no-build | |
| # - name: Publish | |
| # env : | |
| # NUGETAPIKEY: ${{secrets.NUGETAPIKEY}} | |
| # run: dotnet nuget push "**/AzureMapsControl.Components*.nupkg" -s https://api.nuget.org/v3/index.json -k $NUGETAPIKEY --skip-duplicate |