@@ -3,13 +3,7 @@ name: Release
3
3
on :
4
4
push :
5
5
tags : ["v*"]
6
- workflow_dispatch :
7
- inputs :
8
- tag :
9
- description : ' Tag to release'
10
- required : false
11
- default : ' v0.0.0'
12
-
6
+
13
7
permissions :
14
8
contents : write
15
9
39
33
target : x86_64-pc-windows-msvc
40
34
asset_name : windows
41
35
arch : x86_64
42
-
43
36
env :
44
- # Construct the binary name with ".exe" if on Windows
45
37
BINARY_NAME : keywatch-${{ matrix.platform.asset_name }}-${{ matrix.platform.arch }}${{ matrix.platform.os == 'windows-latest' && '.exe' || '' }}
46
38
47
39
steps :
67
59
with :
68
60
targets : ${{ matrix.platform.target }}
69
61
70
- # When targeting aarch64-apple-darwin, ensure the target is added.
71
- # Note: macOS runners already have clang so we do not need a custom linker.
72
- - name : Install cross-compilation tools
62
+ - name : Add aarch64 Apple target
73
63
if : matrix.platform.target == 'aarch64-apple-darwin'
74
- run : |
75
- brew install FiloSottile/musl-cross/musl-cross || true
76
- rustup target add aarch64-apple-darwin
64
+ run : rustup target add aarch64-apple-darwin
77
65
78
66
# Build the specific package
79
67
- name : Build Binary
@@ -87,15 +75,21 @@ jobs:
87
75
cp target/${{ matrix.platform.target }}/release/key-watch${{ matrix.platform.os == 'windows-latest' && '.exe' || '' }} \
88
76
release/${{ env.BINARY_NAME }}
89
77
90
- # Create checksum
91
- - name : Generate SHA-256
78
+ # Windows: Generate checksum using cmd and Windows syntax.
79
+ - name : Generate SHA-256 (Windows)
80
+ if : matrix.platform.os == 'windows-latest'
81
+ shell : cmd
82
+ run : |
83
+ cd release
84
+ certutil -hashfile %BINARY_NAME% SHA256 | findstr /V "hash" > %BINARY_NAME%.sha256
85
+
86
+ # Unix (macOS/Ubuntu): Generate checksum using bash.
87
+ - name : Generate SHA-256 (Unix)
88
+ if : matrix.platform.os != 'windows-latest'
89
+ shell : bash
92
90
run : |
93
91
cd release
94
- if [ "${{ matrix.platform.os }}" = "windows-latest" ]; then
95
- certutil -hashfile ${{ env.BINARY_NAME }} SHA256 | grep -v "hash" > ${{ env.BINARY_NAME }}.sha256
96
- else
97
- shasum -a 256 ${{ env.BINARY_NAME }} > ${{ env.BINARY_NAME }}.sha256
98
- fi
92
+ shasum -a 256 "$BINARY_NAME" > "$BINARY_NAME".sha256
99
93
100
94
# Create Release
101
95
- name : Create Release
0 commit comments