From dcd2d4618747c25f4284760932c3c8c37cecd36b Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Mon, 3 Feb 2025 08:36:23 -0800 Subject: [PATCH] CI Secrets --- Meshtastic.xcodeproj/project.pbxproj | 20 +++++++++++++++++++- SupportingFiles/secrets.json | 4 ++++ ci_scripts/ci_pre_xcodebuild.sh | 16 ++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 SupportingFiles/secrets.json create mode 100755 ci_scripts/ci_pre_xcodebuild.sh diff --git a/Meshtastic.xcodeproj/project.pbxproj b/Meshtastic.xcodeproj/project.pbxproj index f2b3a524..ce44a03b 100644 --- a/Meshtastic.xcodeproj/project.pbxproj +++ b/Meshtastic.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 60; + objectVersion = 70; objects = { /* Begin PBXBuildFile section */ @@ -484,6 +484,7 @@ DDCDC69A29467643004C1DDA /* MeshtasticDataModelV3.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = MeshtasticDataModelV3.xcdatamodel; sourceTree = ""; }; DDCE4E2B2869F92900BE9F8F /* UserConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserConfig.swift; sourceTree = ""; }; DDD28D372C0CD2670063CFA3 /* MeshtasticDataModelV 37.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "MeshtasticDataModelV 37.xcdatamodel"; sourceTree = ""; }; + DDD3A2B22D5127CF0045EB48 /* ci_pre_xcodebuild.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = ci_pre_xcodebuild.sh; sourceTree = ""; }; DDD43FE22A78C8900083A3E9 /* MqttClientProxyManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MqttClientProxyManager.swift; sourceTree = ""; }; DDD5BB082C285DDC007E03CA /* AppLog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLog.swift; sourceTree = ""; }; DDD5BB0A2C285E45007E03CA /* LogDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogDetail.swift; sourceTree = ""; }; @@ -544,6 +545,10 @@ DDFFA7462B3A7F3C004730DB /* Bundle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Bundle.swift; sourceTree = ""; }; /* End PBXFileReference section */ +/* Begin PBXFileSystemSynchronizedRootGroup section */ + DDD3A2AE2D5121BC0045EB48 /* SupportingFiles */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = SupportingFiles; sourceTree = ""; }; +/* End PBXFileSystemSynchronizedRootGroup section */ + /* Begin PBXFrameworksBuildPhase section */ 25F5D5C42C4375A8008036E3 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; @@ -904,6 +909,8 @@ DDC2E14B26CE248E0042C5E4 = { isa = PBXGroup; children = ( + DDD3A2B12D5127B40045EB48 /* ci_scripts */, + DDD3A2AE2D5121BC0045EB48 /* SupportingFiles */, DDDBC87A2BC62E4E001E8DF7 /* Settings.bundle */, 25AECD4E2C2F723200862C8E /* Localizable.xcstrings */, DD3CC6BA28E366DF00FA9159 /* Meshtastic.xcdatamodeld */, @@ -1060,6 +1067,14 @@ path = Persistence; sourceTree = ""; }; + DDD3A2B12D5127B40045EB48 /* ci_scripts */ = { + isa = PBXGroup; + children = ( + DDD3A2B22D5127CF0045EB48 /* ci_pre_xcodebuild.sh */, + ); + path = ci_scripts; + sourceTree = ""; + }; DDD43FE12A78C86B0083A3E9 /* Mqtt */ = { isa = PBXGroup; children = ( @@ -1180,6 +1195,9 @@ dependencies = ( DDDE5A0229AF163E00490C6C /* PBXTargetDependency */, ); + fileSystemSynchronizedGroups = ( + DDD3A2AE2D5121BC0045EB48 /* SupportingFiles */, + ); name = Meshtastic; packageProductDependencies = ( C9697FA427933B8C00250207 /* SQLite */, diff --git a/SupportingFiles/secrets.json b/SupportingFiles/secrets.json new file mode 100644 index 00000000..127b76c1 --- /dev/null +++ b/SupportingFiles/secrets.json @@ -0,0 +1,4 @@ +{ + "PUBLIC_MQTT_USERNAME": "meshdev", + "PUBLIC_MQTT_PASSWORD": "large4cats" +} diff --git a/ci_scripts/ci_pre_xcodebuild.sh b/ci_scripts/ci_pre_xcodebuild.sh new file mode 100755 index 00000000..adc9b04a --- /dev/null +++ b/ci_scripts/ci_pre_xcodebuild.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +echo "Stage: PRE-Xcode Build is activated .... " + +# Move to the place where the scripts are located. +# This is important because the position of the subsequently mentioned files depend of this origin. +cd $CI_PRIMARY_REPOSITORY_PATH/scripts || exit 1 + +# Write a JSON File containing all the environment variables and secrets. +printf "{\"PUBLIC_MQTT_USERNAME\":\"%s\",\"PUBLIC_MQTT_PASSWORD\":\"%s\"}" "$PUBLIC_MQTT_USERNAME" "$PUBLIC_MQTT_PASSWORD" >> .\ ./SupportingFiles/Secrets.json + +echo "Wrote Secrets.json file." + +echo "Stage: PRE-Xcode Build is DONE .... " + +exit 0