Skip to content

Merge pull request #40 from TechnologyEnhancedLearning/Develop/Fixes/… #174

Merge pull request #40 from TechnologyEnhancedLearning/Develop/Fixes/…

Merge pull request #40 from TechnologyEnhancedLearning/Develop/Fixes/… #174

name: Continuous Integration
on: [push]
jobs:
build:
env:
BUILD_CONFIG: 'Release'
SOLUTION: 'NHSUKViewComponents.sln'
name: Build and publish package
runs-on: ubuntu-20.04
permissions:
packages: write
strategy:
matrix:
dotnet-version: ['3.1.x']
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install ICU library
run: sudo apt-get update && sudo apt-get install -y libicu-dev
- name: Setup .NET Core SDK 60
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: '5.5.0'
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.7
- name: Display GitVersion outputs
run: |
echo "Major: ${{ steps.gitversion.outputs.major }}"
echo "Minor: ${{ steps.gitversion.outputs.minor }}"
echo "Patch: ${{ steps.gitversion.outputs.patch }}"
echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}"
- name: Add Azure artifact
run: dotnet nuget add source 'https://pkgs.dev.azure.com/e-LfH/_packaging/LearningHubFeed/nuget/v3/index.json' --name 'LearningHubFeed' --username 'kevin.whittaker' --password ${{ secrets.AZUREDEVOPSKEY }} --store-password-in-clear-text
- name: Add github registry
run: dotnet nuget add source --username 'kevin.whittaker' --password ${{ secrets.NUGETKEY }} --store-password-in-clear-text --name githubPackages "https://nuget.pkg.github.com/TechnologyEnhancedLearning/index.json"
- name: Dotnet build
run: dotnet build NHSUKViewComponents.sln --configuration release
- name: Package nuget
run: dotnet pack NHSUKViewComponents.sln --configuration release -o:package /p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersionV2 }}
- name: Push generated package to GitHub registry
if: startsWith(github.ref, 'refs/tags/v')
run: dotnet nuget push ./package/*.nupkg --api-key ${{ secrets.NUGETKEY }} --source "githubPackages" --skip-duplicate
- name: Push generated package to Azure Feed
if: startsWith(github.ref, 'refs/tags/v')
run: dotnet nuget push ./package/*.nupkg --source https://pkgs.dev.azure.com/e-LfH/_packaging/LearningHubFeed/nuget/v3/index.json --api-key ${{ secrets.AZUREDEVOPSKEY }} --skip-duplicate