-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (59 loc) · 3.03 KB
/
publish-packages-myget.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Publish packages to dev feed
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
strategy:
matrix:
configuration: [Debug]
dotnet-version: [ '3.1.x']
runs-on: windows-latest # For a list of available runner types, refer to
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
env:
Solution_Name: src\Stratis.DevEx.sln
CodeAnalysis_Cs_Project_Path: "src\\Stratis.CodeAnalysis.Cs\\Stratis.CodeAnalysis.Cs\\Stratis.CodeAnalysis.Cs.csproj"
CodeAnalysis_Cs_Test_Project_Path: "tests\\Stratis.CodeAnalysis.Cs.Test\\Stratis.CodeAnalysis.Cs.Test.csproj"
CodeAnalysis_Cs_Package_Project_Path: "src\\Stratis.CodeAnalysis.Cs\\Stratis.CodeAnalysis.Cs.Package\\Stratis.CodeAnalysis.Cs.Package.csproj"
VSTEST_CONNECTION_TIMEOUT: 180
steps:
- name: Install .NET Core 3.1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.x
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Restore the Stratis.DevEx solution
run: dotnet restore "${{ env.Solution_Name }}" /p:Configuration=$env:Configuration
env:
Configuration: ${{ matrix.configuration }}
- name: Build the Stratis.CodeAnalysis.Cs package project
run: dotnet build "${{ env.CodeAnalysis_Cs_Package_Project_Path }}" /p:Configuration=$env:Configuration
env:
Configuration: ${{ matrix.configuration }}
- name: Execute Stratis.CodeAnalysis.Cs unit tests
run: dotnet test "${{ env.CodeAnalysis_Cs_Test_Project_Path }}" -l "console;verbosity=detailed"
- name: Get Stratis.CodeAnalysis.Cs base project version
id: project_version
uses: kzrnm/[email protected]
with:
proj-path: ${{ env.CodeAnalysis_Cs_Project_Path }}
- name: Get git commit SHA
id: git_sha
run: echo "GIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
shell: bash
- name: Set Stratis.CodeAnalysis.Cs CI package version
id: ci_version
run: echo "CI_VERSION=${{ steps.project_version.outputs.assembly-version }}-ci$(printf "%07d" ${{ github.run_number }})git${{ env.GIT_SHA }}" >> $GITHUB_ENV
shell: bash
- name: Pack Stratis.CodeAnalysis.Cs package
run: dotnet pack ${{ env.CodeAnalysis_Cs_Package_Project_Path }} --configuration Debug -p:Version=${{ env.CI_VERSION }} --no-build --output .
- name: Push Stratis.CodeAnalysis.Cs package to GitHub dev feed
run: dotnet nuget push .\Stratis.CodeAnalysis.${{ env.CI_VERSION }}.nupkg --source https://nuget.pkg.github.com/stratisdevex/index.json --api-key ${{ secrets.NUGET_TOKEN }}
- name: Push Stratis.CodeAnalysis.Cs package to MyGet dev feed
run: dotnet nuget push .\Stratis.CodeAnalysis.${{ env.CI_VERSION }}.nupkg --source https://www.myget.org/F/stratisdevex/api/v2/package --api-key ${{ secrets.MYGET_TOKEN }}