Skip to content

Commit c82d3bb

Browse files
authored
Update build action to remove redundent ad-hoc signing and update auto sha256
1 parent 6b155fb commit c82d3bb

1 file changed

Lines changed: 11 additions & 13 deletions

File tree

.github/workflows/build.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,6 @@ jobs:
183183
FLUTTER_XCODE_CODE_SIGN_IDENTITY: ""
184184
FLUTTER_XCODE_CODE_SIGNING_REQUIRED: "NO"
185185

186-
- name: Ad-hoc sign macOS app
187-
run: |
188-
APP_PATH="build/macos/Build/Products/Release/MCCompanion.app"
189-
codesign --force --deep --sign - "$APP_PATH"
190-
codesign --verify --deep --strict "$APP_PATH"
191-
192186
- name: Create macOS DMG
193187
run: |
194188
STAGING_DIR="$RUNNER_TEMP/dmg-staging"
@@ -257,29 +251,33 @@ jobs:
257251
- name: Update Flatpak manifest SHA256
258252
shell: bash
259253
run: |
260-
# Compute the new tarball SHA256 checksum
254+
# Ensure ruamel.yaml is available
255+
python3 -m pip install ruamel.yaml
256+
261257
NEW_SHA256=$(sha256sum MCCompanion-linux-x64.tar.gz | awk '{print $1}')
262258
echo "New SHA256: $NEW_SHA256"
263259
264-
# Update the sha256 field for the archive source in net.mccompanion.MCCompanion.yml
265260
python3 - "$NEW_SHA256" <<'PY'
266261
import sys
267-
import yaml
262+
from ruamel.yaml import YAML
268263
269264
new_sha = sys.argv[1]
270265
manifest_path = 'flatpak/net.mccompanion.MCCompanion.yml'
271266
267+
yaml = YAML()
268+
yaml.preserve_quotes = True
269+
272270
with open(manifest_path, 'r') as f:
273-
data = yaml.safe_load(f)
271+
data = yaml.load(f)
274272
275273
for mod in data.get('modules', []):
276-
if mod.get('name') == 'MCCompanion':
274+
if isinstance(mod, dict) and mod.get('name') == 'MCCompanion':
277275
for src in mod.get('sources', []):
278-
if src.get('type') == 'archive':
276+
if isinstance(src, dict) and src.get('type') == 'archive':
279277
src['sha256'] = new_sha
280278
281279
with open(manifest_path, 'w') as f:
282-
yaml.dump(data, f, default_flow_style=False, sort_keys=False)
280+
yaml.dump(data, f)
283281
284282
print(f"Updated {manifest_path} with new SHA256: {new_sha}")
285283
PY

0 commit comments

Comments
 (0)