Skip to content

Commit a9f7b8e

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

File tree

6 files changed

+49
-5
lines changed

6 files changed

+49
-5
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: 14 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-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: |
@@ -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

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@
5050
<DefineConstants>$(DefineConstants);BROWSER;WASM;IsBrowser;IsWasm</DefineConstants>
5151
</PropertyGroup>
5252

53-
<PropertyGroup Condition="$([System.String]::Copy($(RuntimeIdentifier)).Contains('x64')) OR $([System.String]::Copy($(RuntimeIdentifier)).Contains('win-x64'))">
53+
<PropertyGroup Condition="$([System.String]::Copy($(RuntimeIdentifier)).Contains('x64'))">
5454
<IsX64>true</IsX64>
5555
<DefineConstants>$(DefineConstants);X64;IsX64</DefineConstants>
5656
</PropertyGroup>
5757

58-
<PropertyGroup Condition="$([System.String]::Copy($(RuntimeIdentifier)).Contains('x86')) OR $([System.String]::Copy($(RuntimeIdentifier)).Contains('win-x86'))">
58+
<PropertyGroup Condition="$([System.String]::Copy($(RuntimeIdentifier)).Contains('x86'))">
5959
<IsX86>true</IsX86>
6060
<DefineConstants>$(DefineConstants);X86;IsX86</DefineConstants>
6161
</PropertyGroup>

src/Build.Watchdog.targets

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,10 @@
3434
BeforeTargets="BeforeResolveReferences"
3535
Inputs="$(WatchdogProject)"
3636
Outputs="$(WatchdogExecutable)">
37-
38-
<Message Text="Watchdog executable is out-of-date. Building..." Importance="high"/>
37+
<Message Text="Watchdog executable is out-of-date. Building... $(RuntimeIdentifier):$(TargetFrameworkPrefix)" Importance="high"/>
3938

4039
<MSBuild Projects="$(WatchdogProject)"
4140
Targets="Publish"
42-
Properties="PublishDir=$(WatchdogOutDir);" />
41+
Properties="PublishDir=$(WatchdogOutDir);RuntimeIdentifier=$(RuntimeIdentifier);TargetFramework=$(TargetFrameworkPrefix);Version=$(Version)" />
4342
</Target>
4443
</Project>

src/Everywhere.Watchdog/Everywhere.Watchdog.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<PublishAot>true</PublishAot>
66
<SelfContained>true</SelfContained>
77
<OptimizationPreference>Size</OptimizationPreference>
8+
<RuntimeIdentifiers>win-x64;osx-x64;osx-arm64</RuntimeIdentifiers>
89
</PropertyGroup>
910

1011
<ItemGroup>

0 commit comments

Comments
 (0)