forked from eclipse-aaspe/server
-
Notifications
You must be signed in to change notification settings - Fork 0
190 lines (162 loc) · 5.91 KB
/
check-release.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
name: 'Test and verify branch'
on:
pull_request:
branches:
- main
- release
types: [ opened, synchronize, reopened, edited ]
push:
branches:
- main
- release
jobs:
run-unit-tests:
runs-on: ubuntu-latest
name: Run all project unit tests
permissions:
contents: write
pull-requests: write
actions: read
checks: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Build
run: dotnet build --configuration Release
working-directory: src
- name: Test
run: dotnet test --logger "trx;LogFileName=test-results.trx" || true
working-directory: src
- name: upload test report
uses: actions/upload-artifact@v4
with:
name: test-results
path: "**/test-results.trx"
test-docker-images:
runs-on: ubuntu-latest
name: Build all docker images
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build AasxServerBlazor
uses: docker/build-push-action@v6
with:
push: false
load: true
file: ./src/docker/Dockerfile-AasxServerBlazor
tags: adminshellio/aasx-server-blazor:test
- name: Build AasxServerBlazor-arm32
uses: docker/build-push-action@v6
with:
push: false
load: true
file: ./src/docker/Dockerfile-AasxServerBlazor-arm32
tags: adminshellio/aasx-server-blazor-arm32:test
- name: Build AasxServerBlazor-arm64
uses: docker/build-push-action@v6
with:
push: false
load: true
file: ./src/docker/Dockerfile-AasxServerBlazor-arm64
tags: adminshellio/aasx-server-blazor-arm64:test
- name: Build AasxServerCore
uses: docker/build-push-action@v6
with:
push: false
load: true
file: ./src/docker/Dockerfile-AasxServerAspNetCore
tags: adminshellio/aasx-server-core:test
- name: Build AasxServerCore-arm32
uses: docker/build-push-action@v6
with:
push: false
load: true
file: ./src/docker/Dockerfile-AasxServerAspNetCore-arm32
tags: adminshellio/aasx-server-core-arm32:test
- name: Build AasxServerCore-arm64
uses: docker/build-push-action@v6
with:
push: false
load: true
file: ./src/docker/Dockerfile-AasxServerAspNetCore-arm64
tags: adminshellio/aasx-server-core-arm64:test
check-release:
runs-on: windows-latest
name: Check that the whole project is buildable and attach packages to process
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set execution policy
run: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
shell: pwsh
- name: Set timestamp
id: set_timestamp
run: |
$current_time = $(date +'%Y-%m-%d-T-%H-%M-%S')
echo "timestamp=$current_time" >> $env:GITHUB_OUTPUT
Write-Host "The current timestamp is: $current_time"
- name: Extract branch name
id: extract_branch
run: |
git fetch --all
$commitSHA = git rev-parse HEAD
$branch = git branch -r --contains $commitSHA | Select-String -Pattern 'origin/' | Select-Object -First 1 | ForEach-Object { $_.Line -replace '.*origin/', '' } | ForEach-Object { $_.Trim() }
echo "branch=$branch" >> $env:GITHUB_OUTPUT
Write-Host "The current branch is: $branch"
shell: pwsh
- name: Generate Version Number
working-directory: src
id: generate_version_number
run: |
$branch = '${{ steps.extract_branch.outputs.branch }}'
$version = .\BuildVersionNumber.ps1 -suffix alpha -branch $branch -githubRunNumber ${{ github.run_number }}
echo "version=$version" >> $env:GITHUB_OUTPUT
Write-Host "The version name to build is: $version"
shell: pwsh
- name: Update version numbers in project
working-directory: src
run: |
$version = '${{ steps.generate_version_number.outputs.version }}'
Write-Host "Updating project versions to: $version"
.\UpdateProjectVersions.ps1 -version $version
shell: pwsh
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Build release
working-directory: src
run: .\BuildForRelease.ps1
shell: pwsh
- name: Package release
working-directory: src
run: |
$version = '${{ steps.generate_version_number.outputs.version }}'
mkdir -p artefacts/release/$version
Write-Host "Packaging for the release version: $version"
.\PackageRelease.ps1 -version $version
shell: pwsh
- name: Upload AasxServerBlazor
uses: actions/upload-artifact@v4
with:
name: AasxServerBlazor.LATEST.${{ steps.generate_version_number.outputs.version }}.${{ steps.set_timestamp.outputs.timestamp }}
path: artefacts/release/${{ steps.generate_version_number.outputs.version }}/AasxServerBlazor.zip
if-no-files-found: error
- name: Upload AasxServerAspNetCore
uses: actions/upload-artifact@v4
with:
name: AasxServerAspNetCore.LATEST.${{ steps.generate_version_number.outputs.version }}.${{ steps.set_timestamp.outputs.timestamp }}
path: artefacts/release/${{ steps.generate_version_number.outputs.version }}/AasxServerAspNetCore.zip
if-no-files-found: error