-
-
Notifications
You must be signed in to change notification settings - Fork 12
145 lines (126 loc) · 4.15 KB
/
cicd.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: CICD
on:
workflow_dispatch:
push:
branches:
- 'main'
- 'alpha'
- 'beta'
- 'dev'
pull_request:
types: [opened, reopened, synchronize]
jobs:
build-test:
name: Build & Test
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Test
run: dotnet test -c Release --collect:"XPlat Code Coverage"
- name: Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.cobertura.xml
fail_ci_if_error: true
semantic-release:
name: Bump Version
needs: [build-test]
runs-on: ubuntu-latest
outputs:
new_release_published: ${{ steps.semantic.outputs.new_release_published }}
new_release_version: ${{ (steps.semantic.outputs.new_release_published && steps.semantic.outputs.new_release_version) || '0.0.1' }}
steps:
- uses: actions/checkout@v4
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
id: semantic
with:
dry_run: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-matrix:
name: Publish Installers
runs-on: ${{ matrix.runs-on }}
needs: [semantic-release]
strategy:
matrix:
include:
- rid: win-x64
fileName: KubeUI.Desktop.exe
runs-on: windows-latest
icon: --icon ../KubeUI/Assets/icon.ico
- rid: win-arm64
fileName: KubeUI.Desktop.exe
runs-on: windows-latest
icon: --icon ../KubeUI/Assets/icon.ico
- rid: linux-x64
fileName: KubeUI.Desktop
runs-on: ubuntu-latest
icon: ''
- rid: linux-arm64
fileName: KubeUI.Desktop
runs-on: ubuntu-latest
icon: ''
- rid: osx-x64
fileName: KubeUI.Desktop
runs-on: macos-latest
icon: --icon ../KubeUI/Assets/icon.icns
- rid: osx-arm64
fileName: KubeUI.Desktop
runs-on: macos-latest
icon: --icon ../KubeUI/Assets/icon.icns
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Install Velopack
run: dotnet tool install -g vpk
- name: Install Velopack Deps
if: matrix.runs-on == 'ubuntu-latest'
run: sudo apt install libfuse2
- name: Publish
working-directory: src/KubeUI.Desktop
run: dotnet publish -c Release -r ${{ matrix.rid }} -o bin/publish -p:Version=${{ needs.semantic-release.outputs.new_release_version }}
- name: Create Release
working-directory: src/KubeUI.Desktop
run: |
vpk download github --repoUrl https://github.com/${{ github.repository }} --token ${{ secrets.GITHUB_TOKEN }} -c ${{ matrix.rid }} --pre
vpk pack --packTitle KubeUI -u KubeUI -v ${{ needs.semantic-release.outputs.new_release_version }} -p bin/publish -c ${{ matrix.rid }} -e ${{ matrix.fileName }} -o packed ${{ matrix.icon }}
- name: Remove unnecessary assets
working-directory: src/KubeUI.Desktop
shell: pwsh
run: |
Remove-Item -Path packed/assets.*
Remove-Item -Path packed/RELEASES-*
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.rid }}-artifacts
path: src/KubeUI.Desktop/packed
release:
if: needs.semantic-release.outputs.new_release_published == 'true'
name: Create Release
needs: [semantic-release, publish-matrix]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist/
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}