forked from GitTools/actions
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (101 loc) · 4.08 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: CI
on:
push:
branches:
- main
- 'fix/*'
- 'feature/*'
pull_request:
branches:
- main
workflow_dispatch:
defaults:
run:
shell: pwsh
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest, ubuntu-latest, macos-15 ]
fail-fast: false
steps:
- uses: actions/checkout@v4
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
with:
fetch-depth: 0
token: ${{ secrets.PUSH_GITHUB_TOKEN }}
- uses: actions/checkout@v4
if: github.event_name == 'pull_request'
with:
fetch-depth: 0
- run: |
npm install
name: Install dependencies
- run: |
npm run lint:check && npm run format:check && npm run mdlint:check
name: Check code formatting
- run: |
npm run build:tools
npm run build:agent:github
npm run build:agent:azure
name: Build code
- run: |
npm run test:ci
name: Run tests
- name: Test Summary
uses: test-summary/action@v2.4
with:
paths: junit-report.xml
- name: gitversion/setup
uses: ./gitversion/setup
with:
versionSpec: '6.x'
- name: gitversion/command (showvariable)
uses: ./gitversion/command
with:
arguments: '/showvariable FullSemVer'
- name: gitversion/command (format)
uses: ./gitversion/command
with:
arguments: '/format {Major}.{Minor}'
- name: gitversion/execute
id: gitversion # step id used as reference for output values
uses: ./gitversion/execute
with:
targetPath: './'
disableCache: true
disableNormalization: false
overrideConfig: |
update-build-number=false
- run: |
echo "Major (env.major) : ${{ env.major }}"
echo "Major (env.GitVersion_Major) : ${{ env.GitVersion_Major }}"
echo "Major (steps.gitversion.outputs.major) : ${{ steps.gitversion.outputs.major }}"
echo "Major (steps.gitversion.outputs.GitVersion_Major) : ${{ steps.gitversion.outputs.GitVersion_Major }}"
echo "Minor (env.minor) : ${{ env.minor }}"
echo "Minor (env.GitVersion_Minor) : ${{ env.GitVersion_Minor }}"
echo "Minor (steps.gitversion.outputs.minor) : ${{ steps.gitversion.outputs.minor }}"
echo "Minor (steps.gitversion.outputs.GitVersion_Minor) : ${{ steps.gitversion.outputs.GitVersion_Minor }}"
echo "Patch (env.patch) : ${{ env.patch }}"
echo "Patch (env.GitVersion_Patch) : ${{ env.GitVersion_Patch }}"
echo "Patch (steps.gitversion.outputs.patch) : ${{ steps.gitversion.outputs.patch }}"
echo "Patch (steps.gitversion.outputs.GitVersion_Patch) : ${{ steps.gitversion.outputs.GitVersion_Patch }}"
echo "FullSemVer (env.fullSemVer) : ${{ env.fullSemVer }}"
echo "FullSemVer (env.GitVersion_FullSemVer) : ${{ env.GitVersion_FullSemVer }}"
echo "FullSemVer (steps.gitversion.outputs.fullSemVer) : ${{ steps.gitversion.outputs.fullSemVer }}"
echo "FullSemVer (steps.gitversion.outputs.GitVersion_FullSemVer) : ${{ steps.gitversion.outputs.GitVersion_FullSemVer }}"
name: Use variables and output
- name: Check for changes
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push'
id: status
run: |
if ($null -ne (git status --porcelain)) { echo "has_changes=1"; echo "has_changes=1" >> $env:GITHUB_OUTPUT }
- name: Rebuild dist and push
run: |
git add --verbose .
git config user.name 'Artur Stolear'
git config user.email 'artur.stolear@gmail.com'
git commit -m 'dist update' --allow-empty
git push --force
if: steps.status.outputs.has_changes == '1'