Bump Microsoft.ServiceFabric.* from 7.1.1541 to 7.1.1951 (#182) #32
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: NuGetCD | |
on: | |
push: | |
branches: [ master ] | |
paths: | |
- '**.cs' | |
- '**.csproj' | |
workflow_dispatch: | |
jobs: | |
prepare: | |
name: FetchAndTag | |
runs-on: windows-latest | |
env: | |
Test_Project_File: \test\ServiceFabric.Mocks.NetCoreTests\ServiceFabric.Mocks.NetCoreTests.csproj | |
steps: | |
- uses: actions/checkout@v3 | |
# create version | |
- name: Bump version and push tag | |
id: tag_version | |
uses: loekd/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
dry_run: false | |
# install dotnet 6 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 6.0.x | |
# Install SF SDK | |
- name: Install SF | |
shell: pwsh | |
run: | | |
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force -Scope CurrentUser | |
$ProgressPreference = 'SilentlyContinue' | |
Invoke-WebRequest -OutFile setup.exe -Uri https://download.microsoft.com/download/b/8/a/b8a2fb98-0ec1-41e5-be98-9d8b5abf7856/MicrosoftServiceFabric.10.0.1816.9590.exe | |
.\setup.exe /accepteula /force /quiet | |
# Create SNK | |
- name: Create SNK | |
shell: pwsh | |
run: | | |
.\ExtractPrivateKey.ps1 "${{ secrets.Pfx_Key }}" | |
# Execute all unit tests in the solution | |
- name: Execute unit tests | |
run: dotnet test --logger "trx;LogFileName=results.trx" ${Test_Project_File} | |
#Publish test results | |
- name: Publish Test Results | |
uses: loekd/publish-unit-test-result-action/composite@v2 | |
if: always() | |
with: | |
trx_files: "**/*.trx" | |
# Run dotnet release build | |
- name: Run build | |
run: dotnet build --configuration RELEASE -p:PackageVersion=${{ steps.tag_version.outputs.new_version }} | |
# Run dotnet release pack | |
- name: Run build | |
run: dotnet pack --configuration RELEASE -p:PackageVersion=${{ steps.tag_version.outputs.new_version }} -o ${{ github.workspace }} | |
# create GH release | |
- name: Create a GitHub release | |
uses: loekd/release-action@v1 | |
with: | |
tag: ${{ steps.tag_version.outputs.new_tag }} | |
name: Release ${{ steps.tag_version.outputs.new_tag }} | |
body: ${{ steps.tag_version.outputs.changelog }} | |
# publish nuget package artifact | |
- name: Upload Package for Publishing | |
uses: actions/upload-artifact@v3 | |
with: | |
name: PackedLib | |
path: ${{ github.workspace }}/ServiceFabric.Mocks.${{ steps.tag_version.outputs.new_version }}.nupkg | |
# publish GH nuget package artifact | |
- name: Push Package to GitHub | |
run: dotnet nuget push --api-key ${{secrets.GITHUB_TOKEN}} --source "https://nuget.pkg.github.com/loekd/index.json" ${{ github.workspace }}/ServiceFabric.Mocks.${{ steps.tag_version.outputs.new_version }}.nupkg | |
# publish packge to nuget | |
- name: Push Package to GitHub | |
run: dotnet nuget push --api-key ${{secrets.NUGETPUSH}} --source "https://api.nuget.org/v3/index.json" ${{ github.workspace }}/ServiceFabric.Mocks.${{ steps.tag_version.outputs.new_version }}.nupkg | |