-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (86 loc) · 3.36 KB
/
ci.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Nuget client Continuous integration
on:
push:
branches:
- 'main'
- 'develop'
- 'release/*'
pull_request:
branches:
- '*'
env:
JIRA_USERNAME: ${{ secrets.JIRA_USERNAME }}
JIRA_PASSWORD: ${{ secrets.JIRA_PASSWORD }}
jobs:
build_test_pack:
name: Build, test & pack
runs-on: windows-latest
env:
buildConfiguration: release
versionSuffix: ${{ github.ref == 'refs/heads/develop' && '-inte-' || contains(github.ref,'release/') && '-pre-' || '-ci-' }}${{github.RUN_NUMBER }}
outputs:
versionSuffix: ${{env.versionSuffix}}
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Set up Node.js ⚙️
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Setup .NET Core @ Latest
uses: actions/setup-dotnet@v1
with:
source-url: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Install commerce dependencies
run: yarn install --frozen-lockfile
working-directory: src/EPiServer.Marketing.KPI.Commerce/clientResources
- name: Build KPI Commerce
run: yarn build
working-directory: src/EPiServer.Marketing.KPI.Commerce/clientResources
- name: Install cms dependencies
run: yarn install --frozen-lockfile
working-directory: src/EPiServer.Marketing.Testing.Web/clientResources/config
- name: Build Testing
run: yarn build
working-directory: src/EPiServer.Marketing.Testing.Web/clientResources/config
- name: Restore
run: dotnet restore EPiServer.Marketing.Testing.sln --configfile Nuget.config
- name: Build (Release version)
if: ${{ github.ref == 'refs/heads/main' }}
run: dotnet build --no-restore --configuration $env:buildConfiguration
- name: Build (Pre-Release version)
if: ${{ github.ref != 'refs/heads/main' }}
run: dotnet build --no-restore --configuration $env:buildConfiguration --version-suffix $env:versionSuffix
- name: Test
run: dotnet test --no-build --configuration $env:buildConfiguration
- name: Pack (Release version)
if: ${{ github.ref == 'refs/heads/main' }}
run: |
./build/pack.ps1
- name: Pack (Pre-Release version)
if: ${{ github.ref != 'refs/heads/main' }}
run: |
./build/pack.ps1 -versionSuffix $env:versionSuffix
- name: Publish packages
run: dotnet nuget push artifacts/**/*.nupkg --skip-duplicate -k ${{ secrets.GITHUB_TOKEN }}
jira-release:
if: ${{ contains(github.ref,'release/') }}
runs-on: windows-latest
name: Get release version & create JIRA release
needs: build_test_pack
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Get release version
uses: hungoptimizely/jira-automation/releaseversion@v1
id: branchVersion
- name: Create JIRA release
uses: hungoptimizely/jira-automation/release@v1
with:
jira-project: MAR
jira-package: EPiServer.Marketing.Testing
jira-host: jira.sso.episerver.net
version: ${{ steps.branchVersion.outputs.manifestSafeVersionString }}
versionSuffix: ${{needs.build_test_pack.outputs.versionSuffix}}