-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (74 loc) · 5.22 KB
/
Copy pathgithub-actions.yml
File metadata and controls
94 lines (74 loc) · 5.22 KB
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
#
# https://docs.github.com/en/actions/migrating-to-github-actions/automated-migrations/migrating-from-azure-devops-with-github-actions-importer#environment-variable-mapping
#
name: '🏗 📦 Build, Pack & Deploy Nugets'
env:
MR_BUILD_REPOSITORY_FOLDERPATH: ${{ github.workspace }}
MR_SOURCE_BRANCH: ${{ github.ref }}
MR_REPOSITORY_PATH: ${{ github.repository }}
MR_GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MR_GITHUB_NUGET_FEED_URL: "https://nuget.pkg.github.com/dsidirop/index.json"
MR_GITHUB_NUGET_FEED_USERNAME: ${{ secrets.MR_GITHUB_NUGET_FEED_USERNAME }}
DOTNET_TARGET_WORKLOAD_VERSION: "10.0.100-preview.5.25306.3" # dont upgrade this lightheartedly the workload snapshot implicitly defines which versions of Android/iOS/MacCatalyst SDKs are supported
on:
workflow_call: # so that other workflows can trigger this
workflow_dispatch: # allows to run this workflow manually from the actions tab
push:
branches:
- '**' # '*' matches zero or more characters but does not match the `/` character '**' matches zero or more of any character
pull_request: # we need to build on pull requests so that we can generate and upload the sbom before merging onto main/develop branches
branches:
- '**'
jobs:
build:
runs-on: 'windows-2022'
# variable substitution is not supported in github at all so we cant do stuff like this
#
# env:
# Build_Artifacts_Folderpath: ${{env.MR_BUILD_REPOSITORY_FOLDERPATH}}/Artifacts
steps:
- name: '🔽 Checkout'
uses: 'actions/checkout@v4'
with:
fetch-tags: true # https://github.com/actions/checkout/issues/1471#issuecomment-1771231294
fetch-depth: 0
- name: '🛠 Setup Build Environment'
shell: 'bash'
run: |
chmod +x "${{env.MR_BUILD_REPOSITORY_FOLDERPATH}}/Ci/MazeRunner.SetupBuildEnvironment.sh" \
&& \
"${{env.MR_BUILD_REPOSITORY_FOLDERPATH}}/Ci/MazeRunner.SetupBuildEnvironment.sh" \
"${{env.DOTNET_TARGET_WORKLOAD_VERSION}}" \
"${{env.MR_GITHUB_NUGET_FEED_URL}}" \
"${{env.MR_GITHUB_NUGET_FEED_USERNAME}}" \
"${{env.MR_GITHUB_ACCESS_TOKEN}}" \
"${{env.MR_BUILD_REPOSITORY_FOLDERPATH}}/Artifacts"
- name: '🏗 📦 Build, Pack & Announce New Release (if appropriate)'
shell: 'bash'
run: |
cd "${{env.MR_BUILD_REPOSITORY_FOLDERPATH}}/Ci" \
&& \
dotnet \
msbuild \
"MazeRunner.Builder.targets" \
-m:1 \
\
-p:PackageOutputPath="${{env.MR_BUILD_REPOSITORY_FOLDERPATH}}/Artifacts" \
\
-p:MazeRunner_Source_Branch="${{env.MR_SOURCE_BRANCH}}" \
-p:MazeRunner_Repository_Path="${{env.MR_REPOSITORY_PATH}}" \
-p:MazeRunner_Github_Access_Token="${{env.MR_GITHUB_ACCESS_TOKEN}}" \
-p:MazeRunner_Test_Results_Folderpath="${{env.MR_BUILD_REPOSITORY_FOLDERPATH}}/TestResults"
- name: '⬆️ Upload Artifacts' # to share with other workflows https://stackoverflow.com/a/77663335/863651
uses: 'actions/upload-artifact@v4'
with:
name: 'Artifacts'
path: '${{env.MR_BUILD_REPOSITORY_FOLDERPATH}}/Artifacts/**/*'
- name: '📡 Publish Test Results' # https://github.com/marketplace/actions/publish-test-results
uses: 'EnricoMi/publish-unit-test-result-action/windows@v2'
continue-on-error: true # sometimes this action spazes out and fails we ignore such hiccups because they are not really critical
if: always() # this means: "run even if prior steps fail" if tests fail, the build will fail, but at least we will know exactly what failed
with:
files: |
TestResults/**/*.xml
TestResults/**/*.trx