Skip to content

Commit 29141db

Browse files
committed
build(macOS): fix watchdog on osx-x64
1 parent 96c3b4c commit 29141db

File tree

4 files changed

+51
-3
lines changed

4 files changed

+51
-3
lines changed

.github/workflows/linux-release.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
tags:
66
- 'v*.*.*'
7+
workflow_dispatch:
78

89
jobs:
910
build-linux:
@@ -27,6 +28,18 @@ jobs:
2728
submodules: true
2829
lfs: true
2930

31+
- name: Verify Tag (Manual Trigger)
32+
if: github.event_name == 'workflow_dispatch'
33+
run: |
34+
TAG=$(git describe --exact-match --tags HEAD 2>/dev/null || echo "")
35+
if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
36+
echo "Error: Current commit is not tagged with a valid version (vX.X.X)."
37+
echo "Current tag: $TAG"
38+
exit 1
39+
fi
40+
echo "Found valid tag: $TAG"
41+
echo "GITHUB_REF=refs/tags/$TAG" >> $GITHUB_ENV
42+
3043
- name: Get version from tag
3144
id: get_version
3245
run: |

.github/workflows/macos-release.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
tags:
66
- 'v*.*.*'
7+
workflow_dispatch:
78

89
jobs:
910
build-mac:
@@ -24,6 +25,18 @@ jobs:
2425
submodules: true
2526
lfs: true
2627

28+
- name: Verify Tag (Manual Trigger)
29+
if: github.event_name == 'workflow_dispatch'
30+
run: |
31+
TAG=$(git describe --exact-match --tags HEAD 2>/dev/null || echo "")
32+
if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
33+
echo "Error: Current commit is not tagged with a valid version (vX.X.X)."
34+
echo "Current tag: $TAG"
35+
exit 1
36+
fi
37+
echo "Found valid tag: $TAG"
38+
echo "GITHUB_REF=refs/tags/$TAG" >> $GITHUB_ENV
39+
2740
- name: Get version from tag
2841
id: get_version
2942
run: |
@@ -65,7 +78,7 @@ jobs:
6578
run: dotnet workload restore src/Everywhere.Mac/Everywhere.Mac.csproj
6679

6780
- name: Restore
68-
run: dotnet restore Everywhere.Mac.slnf -r ${{ matrix.runtime }}
81+
run: dotnet restore Everywhere.Mac.slnf -r ${{ matrix.runtime }} /p:RuntimeIdentifier=${{ matrix.runtime }}
6982

7083
- name: Publish
7184
env:
@@ -75,6 +88,7 @@ jobs:
7588
dotnet publish src/Everywhere.Mac/Everywhere.Mac.csproj \
7689
-c Release \
7790
-r ${{ matrix.runtime }} \
91+
/p:RuntimeIdentifier=${{ matrix.runtime }} \
7892
/p:CodesignKey="$CODE_SIGN_KEY" \
7993
/p:PackageSigningKey="$PACKAGE_SIGNING_KEY" \
8094
/p:Version=${{ env.VERSION }} \

.github/workflows/windows-release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
tags:
66
- 'v*.*.*'
7+
workflow_dispatch:
78

89
jobs:
910
build-and-release:
@@ -19,6 +20,22 @@ jobs:
1920
fetch-depth: 0
2021
submodules: true
2122
lfs: true
23+
24+
- name: Verify Tag (Manual Trigger)
25+
if: github.event_name == 'workflow_dispatch'
26+
shell: pwsh
27+
run: |
28+
$tag = git describe --exact-match --tags HEAD 2>$null
29+
if ($LASTEXITCODE -ne 0) {
30+
Write-Error "Error: Current commit is not tagged."
31+
exit 1
32+
}
33+
if ($tag -notmatch '^v\d+\.\d+\.\d+') {
34+
Write-Error "Error: Current commit tag '$tag' does not match vX.X.X format."
35+
exit 1
36+
}
37+
Write-Host "Found valid tag: $tag"
38+
echo "GITHUB_REF=refs/tags/$tag" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
2239
2340
- name: Get version from tag
2441
id: get_version

src/Build.Watchdog.targets

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,14 @@
3535
Inputs="$(WatchdogProject)"
3636
Outputs="$(WatchdogExecutable)">
3737

38-
<Message Text="Watchdog executable is out-of-date. Building..." Importance="high"/>
38+
<Message Text="Watchdog executable is out-of-date. Building... $(RuntimeIdentifier):$(TargetFrameworkPrefix)" Importance="high"/>
39+
40+
<MSBuild Projects="$(WatchdogProject)"
41+
Targets="Restore"
42+
Properties="RuntimeIdentifier=$(RuntimeIdentifier);TargetFramework=$(TargetFrameworkPrefix)" />
3943

4044
<MSBuild Projects="$(WatchdogProject)"
4145
Targets="Publish"
42-
Properties="PublishDir=$(WatchdogOutDir);" />
46+
Properties="PublishDir=$(WatchdogOutDir);RuntimeIdentifier=$(RuntimeIdentifier);TargetFramework=$(TargetFrameworkPrefix);Version=$(Version)" />
4347
</Target>
4448
</Project>

0 commit comments

Comments
 (0)