-
Notifications
You must be signed in to change notification settings - Fork 3
109 lines (90 loc) · 2.86 KB
/
github-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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Pip.Services Commons .NET Delivery
# Configure trigger rules
on:
push:
branches:
- master
paths:
- '**'
- '!README.md'
workflow_dispatch:
jobs:
# Setup job
setup:
runs-on: ubuntu-22.04
if: "!contains(github.event.head_commit.message, '[skip-ci]')"
steps:
- name: Checkout source code
uses: actions/checkout@main
- name: Pull delivery scripts
shell: bash
run: |
rm -rf script-delivery-ps
git clone ${{ secrets.SCRIPTS_DELIVERY_PS_GIT_URL }} eic-templates-cicd-ps
cp -r eic-templates-cicd-ps/script-delivery-ps script-delivery-ps
- name: Execute increment script
shell: bash
run: ./script-delivery-ps/setup/increment/increment.ps1
- name: Execute prerequisites script
shell: bash
run: ./script-delivery-ps/setup/prereqs/prereqs.ps1
- name: Cache intermediate data
uses: actions/cache@v3
with:
path: |
script-delivery-ps
component*.json
key: delivery-${{ github.run_id }}-${{ github.run_attempt }}
# Authoring job
authoring:
needs: setup
runs-on: ubuntu-22.04
steps:
- name: Checkout source code
uses: actions/checkout@main
- name: Get cached intermediate data
uses: actions/cache@v3
with:
path: |
script-delivery-ps
component*.json
key: delivery-${{ github.run_id }}-${{ github.run_attempt }}
- name: Execute build script
shell: bash
run: script-delivery-ps/authoring/build/build.ps1
- name: Execute test script
shell: bash
run: ./script-delivery-ps/authoring/test/test.ps1
- name: Execute package script
shell: bash
run: ./script-delivery-ps/authoring/package/package.ps1
- name: Execute publish script
shell: bash
run: ./script-delivery-ps/authoring/publish/publish.ps1
env:
NUGET_KEY: ${{ secrets.NUGET_KEY }}
- name: Execute tag script
shell: bash
run: ./script-delivery-ps/authoring/tag/tag.ps1
- name: Execute clean script
if: always()
shell: bash
run: ./script-delivery-ps/authoring/clean/clean.ps1
# Measure job
measure:
needs: authoring
if: always()
runs-on: ubuntu-22.04
steps:
- name: Get cached intermediate data
uses: actions/cache@v3
with:
path: |
script-delivery-ps
component*.json
key: delivery-${{ github.run_id }}-${{ github.run_attempt }}
- name: Execute measure script
env:
name: $(echo '${{ github.repository }}' | awk -F '/' '{print $2}')
run: ./script-delivery-ps/measure/measure.ps1 ${{ github.repository_owner }} ${{ env.name }} ${{ secrets.AWS_ACCESS_KEY_ID }} ${{ secrets.AWS_SECRET_ACCESS_KEY }} ${{ secrets.AWS_S3_BUCKET }} ${{ secrets.AWS_S3_BUCKET_FOLDER }} ${{ secrets.GITHUB_TOKEN }}
shell: bash