|
1 | 1 | # build.yml |
2 | 2 |
|
3 | | -name: Auto Build |
| 3 | +name: Build and Release Client |
4 | 4 |
|
5 | 5 | on: |
6 | 6 | workflow_dispatch: |
@@ -139,60 +139,79 @@ jobs: |
139 | 139 | APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} |
140 | 140 | KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} |
141 | 141 | run: | |
142 | | - echo $APPLE_CERTIFICATE | base64 --decode > certificate.p12 |
| 142 | + # Mask sensitive values in logs |
| 143 | + echo "::add-mask::$KEYCHAIN_PASSWORD" |
| 144 | + echo "::add-mask::$APPLE_CERTIFICATE_PASSWORD" |
| 145 | + |
| 146 | + # Decode certificate without echoing it |
| 147 | + echo "$APPLE_CERTIFICATE" | base64 --decode > certificate.p12 |
143 | 148 | security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain |
144 | 149 | security default-keychain -s build.keychain |
145 | 150 | security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain |
146 | 151 | security set-keychain-settings -t 3600 -u build.keychain |
147 | 152 | security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign |
148 | 153 | security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain |
149 | | - security find-identity -v -p codesigning build.keychain |
| 154 | + |
| 155 | + # Clean up certificate file |
| 156 | + rm -f certificate.p12 |
| 157 | + |
| 158 | + # List identities (only show count, not full details) |
| 159 | + IDENTITY_COUNT=$(security find-identity -v -p codesigning build.keychain | grep -c "valid identities found" || echo "0") |
| 160 | + echo "Found $IDENTITY_COUNT valid code signing identity/identities" |
150 | 161 |
|
151 | 162 | - name: Verify Certificate |
152 | 163 | if: matrix.platform == 'macos-latest' |
153 | 164 | run: | |
154 | | - # List all code signing identities |
155 | | - security find-identity -v -p codesigning build.keychain |
156 | | - |
157 | 165 | # Try to find valid code signing certificate (Developer ID, Apple Distribution, or Apple Development) |
158 | 166 | # Priority: Developer ID Application > Apple Distribution > Apple Development |
159 | | - CERT_INFO=$(security find-identity -v -p codesigning build.keychain | grep -E "Developer ID Application|Apple Distribution|Apple Development" | head -n 1) |
| 167 | + CERT_INFO=$(security find-identity -v -p codesigning build.keychain 2>/dev/null | grep -E "Developer ID Application|Apple Distribution|Apple Development" | head -n 1) |
160 | 168 | |
161 | 169 | if [ -z "$CERT_INFO" ]; then |
162 | 170 | echo "Error: No valid Apple certificate found in keychain" |
163 | | - echo "Available certificates:" |
164 | | - security find-identity -v -p codesigning build.keychain |
| 171 | + # Only show certificate count, not full details |
| 172 | + CERT_COUNT=$(security find-identity -v -p codesigning build.keychain 2>/dev/null | grep -c "valid identities found" || echo "0") |
| 173 | + echo "Found $CERT_COUNT certificate(s) in keychain" |
165 | 174 | exit 1 |
166 | 175 | fi |
167 | 176 | |
168 | 177 | CERT_ID=$(echo "$CERT_INFO" | awk '{print $2}') |
169 | 178 | |
170 | 179 | if [ -z "$CERT_ID" ]; then |
171 | | - echo "Error: Failed to extract certificate ID from: $CERT_INFO" |
| 180 | + echo "Error: Failed to extract certificate ID" |
172 | 181 | exit 1 |
173 | 182 | fi |
174 | 183 | |
| 184 | + # Mask certificate ID in logs |
| 185 | + echo "::add-mask::$CERT_ID" |
| 186 | + |
175 | 187 | # Extract Team ID from certificate name (format: "Developer ID Application: Name (TEAM_ID)") |
176 | 188 | # Use sed to extract content between parentheses |
177 | 189 | TEAM_ID=$(echo "$CERT_INFO" | sed -n 's/.*(\([A-Z0-9]*\)).*/\1/p' | head -n 1) |
178 | 190 | |
179 | 191 | if [ -z "$TEAM_ID" ]; then |
180 | 192 | echo "Warning: Failed to extract Team ID from certificate name, trying alternative method" |
181 | | - # Alternative: try to get from certificate directly using openssl |
| 193 | + # Alternative: try to get from certificate directly using openssl (without outputting full subject) |
182 | 194 | CERT_SUBJECT=$(security find-certificate -c "$CERT_ID" -p build.keychain 2>/dev/null | openssl x509 -noout -subject 2>/dev/null || echo "") |
183 | 195 | if [ -n "$CERT_SUBJECT" ]; then |
184 | 196 | TEAM_ID=$(echo "$CERT_SUBJECT" | sed -n 's/.*OU=\([^/]*\).*/\1/p' | head -n 1) |
185 | 197 | fi |
186 | 198 | fi |
187 | 199 | |
| 200 | + # Mask Team ID in logs |
| 201 | + if [ -n "$TEAM_ID" ]; then |
| 202 | + echo "::add-mask::$TEAM_ID" |
| 203 | + fi |
| 204 | + |
| 205 | + # Set environment variables |
188 | 206 | echo "CERT_ID=$CERT_ID" >> $GITHUB_ENV |
189 | 207 | if [ -n "$TEAM_ID" ]; then |
190 | 208 | echo "APPLE_TEAM_ID=$TEAM_ID" >> $GITHUB_ENV |
191 | | - echo "Team ID: $TEAM_ID" |
192 | 209 | fi |
193 | | - echo "Certificate ID: $CERT_ID" |
194 | | - echo "Certificate info: $CERT_INFO" |
195 | | - echo "Certificate imported and verified." |
| 210 | + |
| 211 | + # Show sanitized info (only certificate type, not full details) |
| 212 | + CERT_TYPE=$(echo "$CERT_INFO" | sed -n 's/.*"\(Developer ID Application\|Apple Distribution\|Apple Development\).*/\1/p') |
| 213 | + echo "✓ Certificate verified: $CERT_TYPE" |
| 214 | + echo "✓ Certificate imported and verified successfully." |
196 | 215 |
|
197 | 216 | - name: Install Go client for current platform |
198 | 217 | run: make install |
@@ -221,8 +240,6 @@ jobs: |
221 | 240 | sudo apt-get update |
222 | 241 | sudo apt-get install -y libwebkit2gtk-4.1-dev libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf |
223 | 242 |
|
224 | | -
|
225 | | -
|
226 | 243 | - name: Install frontend dependencies |
227 | 244 | run: pnpm install |
228 | 245 |
|
|
0 commit comments