Skip to content

Commit

Permalink
add new CI/CD for pre-release
Browse files Browse the repository at this point in the history
  • Loading branch information
Heihokon committed Oct 23, 2023
1 parent ffd5724 commit 42826d0
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
60 changes: 60 additions & 0 deletions .github/workflows/nuget-cd-prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI pipeline
# This workflow is triggered on pushes to the repository.
on:
push:
tags:
- 3.[0-9]+.[0-9]+-alpha.[0-9]+
jobs:
build:
name: Test & Coverage
runs-on: windows-latest
env:
FS_API_KEY: "${{ secrets.FS_CI_CAMPAIGNS_API_KEY }}"
FS_ENV_ID: "${{ secrets.FS_CI_CAMPAIGNS_ENV_ID }}"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: "6.0.x"

- name: Setup NuGet
uses: NuGet/setup-nuget@v1
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"

- name: Restore NuGet Packages
run: nuget restore Flagship.sln

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2

- name: Build dll
run: MSBuild Flagship.Tests/Flagship.Tests.csproj -property:Configuration=Debug

- name: Run tests
shell: pwsh
run: ./coverage-ci.bat

- name: Create signing Key file
shell: pwsh
run: ${{ secrets.ASSEMBLY_SIGNING_KEY }} | Out-File -FilePath flagshipSigningKey.txt

- name: Decode signing Key
shell: pwsh
run: certutil -decode .\flagshipSigningKey.txt .\flagshipSigningKey.snk

- name: Build nuget
run: MSBuild.exe -t:pack -property:Configuration=Release -property:SignAssembly=True -property:AssemblyOriginatorKeyFile=flagshipSigningKey.snk
working-directory: Flagship

- name: set Nuget api key
run: nuget setApiKey ${{ secrets.NUGET_APIKEY }}

- name: Push Nuget Packages
run: nuget push Flagship.SDK.*.nupkg -Source https://api.nuget.org/v3/index.json
working-directory: Flagship/NugetPackageRelease

# - name: Upload coverage to codecov
# uses: codecov/codecov-action@v2
# with:
# files: ./CoverageResults.xml
2 changes: 1 addition & 1 deletion Flagship/Flagship.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<SDKVersion>3.1.4</SDKVersion>
<SDKVersion>3.2.0-alpha.0</SDKVersion>
</PropertyGroup>

<PropertyGroup>
Expand Down

0 comments on commit 42826d0

Please sign in to comment.