-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (65 loc) · 3.78 KB
/
github-compile.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
#
# https://docs.github.com/en/actions/migrating-to-github-actions/automated-migrations/migrating-from-azure-devops-with-github-actions-importer#environment-variable-mapping
#
name: 'Builder'
env:
build_repository_folderpath: ${{ github.workspace }}
on:
workflow_call: # reusable workflows 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
- '!main' # main will trigger/reuse this workflow by other means via workflow call
- '!master' # master will trigger/reuse this workflow by other means via workflow call
- '!develop' # develop will trigger/reuse this workflow by other means via workflow call
jobs:
build:
runs-on: macos-14
# variable substitution is not supported in github at all so we cant do stuff like this
#
# env:
# Build_Artifacts_Folderpath: $build_repository_folderpath/Artifacts
steps:
- name: '🔽 Checkout'
uses: 'actions/checkout@v3'
with:
fetch-depth: 1
- name: '🛠 Setup Build Environment'
shell: 'bash'
run: |
chmod +x "$build_repository_folderpath/Laerdal.Scripts/Laerdal.SetupBuildEnvironment.sh" \
&& \
"$build_repository_folderpath/Laerdal.Scripts/Laerdal.SetupBuildEnvironment.sh" \
"https://nuget.pkg.github.com/Laerdal/index.json" \
"${{ secrets.scl_github_nuget_feed_username }}" \
"${{ secrets.scl_github_access_token }}"
- name: '🏗 📦 Build, Pack & Announce New Release (if appropriate)'
shell: bash
run: |
cd "$build_repository_folderpath/Laerdal.Scripts" \
&& \
dotnet \
msbuild \
"Laerdal.McuMgr.Builder.targets" \
-m:1 \
-p:ShouldSkipMacCatalyst="false" \
\
-p:PackageOutputPath="$build_repository_folderpath/Artifacts" \
-p:Laerdal_Gradle_Path="/opt/homebrew/opt/gradle@7/bin/gradle" \
-p:Laerdal_Source_Branch="${{ github.ref }}" \
-p:Laerdal_Repository_Path="${{ github.repository }}" \
-p:Laerdal_Github_Access_Token="${{ secrets.scl_github_access_token }}" \
-p:Laerdal_Test_Results_Folderpath="$build_repository_folderpath/TestResults"
- name: '📡 Publish Test Results' # https://github.com/marketplace/actions/publish-test-results
uses: EnricoMi/publish-unit-test-result-action/macos@v2
if: always()
with:
files: |
TestResults/**/TEST-*.xml
TestResults/**/TEST-*.trx
- name: '⬆️ Upload Artifacts' # to share with other workflows https://stackoverflow.com/a/77663335/863651
uses: actions/upload-artifact@v3
with:
name: 'nugets'
path: 'Artifacts/**/*.nupkg'