Skip to content

Commit

Permalink
Add OpenAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentTreguier committed Jul 18, 2024
1 parent 1e2a0c0 commit 9aa14bb
Show file tree
Hide file tree
Showing 11 changed files with 1,836 additions and 36 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/get-fingerprint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const packages = require("/tmp/packages.json")
const packageName = process.argv[process.argv.length - 1]
const package = packages.pins.find(p => p.identity === packageName)
console.log(package.state.revision)
3 changes: 3 additions & 0 deletions .github/workflows/publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ jobs:
if: ${{ matrix.distribution == 'standalone' }}
run: make

- name: Trust OpenAPI plugin
run: bash .github/workflows/trust-openapi-plugin.sh

- name: Set up Sentry
if: ${{ matrix.distribution == 'app-store' }}
run: curl -sL https://sentry.io/get-cli/ | sh
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/trust-openapi-plugin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

current_directory=$(dirname $0)
security_directory=~/Library/org.swift.swiftpm/security

cp $current_directory/../../Fyreplace.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved /tmp/packages.json
mkdir -p $security_directory

cat <<< '
[
{
"fingerprint" : "'$(node $current_directory/get-fingerprint.js swift-openapi-generator)'",
"packageIdentity" : "swift-openapi-generator",
"targetName" : "OpenAPIGenerator"
}
]
' | tee $security_directory/plugins.json
73 changes: 72 additions & 1 deletion Fyreplace.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

/* Begin PBXBuildFile section */
4D0DDC262C188869006CD503 /* SentrySwiftUI in Frameworks */ = {isa = PBXBuildFile; productRef = 4D0DDC252C188869006CD503 /* SentrySwiftUI */; };
4D13AF622C482F1C00845FDB /* OpenAPIRuntime in Frameworks */ = {isa = PBXBuildFile; productRef = 4D13AF612C482F1C00845FDB /* OpenAPIRuntime */; };
4D13AF652C482F4500845FDB /* OpenAPIURLSession in Frameworks */ = {isa = PBXBuildFile; productRef = 4D13AF642C482F4500845FDB /* OpenAPIURLSession */; };
4D13AF692C482FE400845FDB /* openapi.yaml in Resources */ = {isa = PBXBuildFile; fileRef = 4D13AF682C482FE300845FDB /* openapi.yaml */; };
4D13AF6B2C48301600845FDB /* openapi-generator-config.yaml in Resources */ = {isa = PBXBuildFile; fileRef = 4D13AF6A2C48301600845FDB /* openapi-generator-config.yaml */; };
4D39A4C82BF516B7003FA52E /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 4D39A4C72BF516B7003FA52E /* Localizable.xcstrings */; };
4D4D394A2C086DA2007196D2 /* PublishedScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D4D39492C086DA2007196D2 /* PublishedScreen.swift */; };
4D5251EC2C1097A600018CD2 /* Destination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D5251EB2C1097A600018CD2 /* Destination.swift */; };
Expand Down Expand Up @@ -63,6 +67,10 @@

/* Begin PBXFileReference section */
4D0DDC292C18A467006CD503 /* .xcode-version */ = {isa = PBXFileReference; lastKnownFileType = text; path = ".xcode-version"; sourceTree = "<group>"; };
4D13AF682C482FE300845FDB /* openapi.yaml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = openapi.yaml; sourceTree = "<group>"; };
4D13AF6A2C48301600845FDB /* openapi-generator-config.yaml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = "openapi-generator-config.yaml"; sourceTree = "<group>"; };
4D13AF6F2C4916AF00845FDB /* trust-openapi-plugin.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "trust-openapi-plugin.sh"; sourceTree = "<group>"; };
4D13AF702C49179D00845FDB /* get-fingerprint.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = "get-fingerprint.js"; sourceTree = "<group>"; };
4D39A4C72BF516B7003FA52E /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };
4D4D39492C086DA2007196D2 /* PublishedScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishedScreen.swift; sourceTree = "<group>"; };
4D5251A22C0A78F800018CD2 /* .gitignore */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitignore; sourceTree = "<group>"; };
Expand Down Expand Up @@ -120,6 +128,8 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4D13AF622C482F1C00845FDB /* OpenAPIRuntime in Frameworks */,
4D13AF652C482F4500845FDB /* OpenAPIURLSession in Frameworks */,
4D0DDC262C188869006CD503 /* SentrySwiftUI in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -146,6 +156,8 @@
children = (
4D39A4C72BF516B7003FA52E /* Localizable.xcstrings */,
4D54C92F2BF2608F001DE071 /* Assets.xcassets */,
4D13AF682C482FE300845FDB /* openapi.yaml */,
4D13AF6A2C48301600845FDB /* openapi-generator-config.yaml */,
);
path = Resources;
sourceTree = "<group>";
Expand Down Expand Up @@ -252,6 +264,8 @@
isa = PBXGroup;
children = (
4D54C95A2BF266F9001DE071 /* publishing.yml */,
4D13AF6F2C4916AF00845FDB /* trust-openapi-plugin.sh */,
4D13AF702C49179D00845FDB /* get-fingerprint.js */,
);
path = workflows;
sourceTree = "<group>";
Expand Down Expand Up @@ -349,10 +363,13 @@
buildRules = (
);
dependencies = (
4D13AF672C482F5900845FDB /* PBXTargetDependency */,
);
name = Fyreplace;
packageProductDependencies = (
4D0DDC252C188869006CD503 /* SentrySwiftUI */,
4D13AF612C482F1C00845FDB /* OpenAPIRuntime */,
4D13AF642C482F4500845FDB /* OpenAPIURLSession */,
);
productName = Fyreplace;
productReference = 4D54C9282BF2608A001DE071 /* Fyreplace.app */;
Expand Down Expand Up @@ -428,6 +445,9 @@
mainGroup = 4D54C91F2BF2608A001DE071;
packageReferences = (
4D0DDC242C188869006CD503 /* XCRemoteSwiftPackageReference "sentry-cocoa" */,
4D13AF5F2C482F0100845FDB /* XCRemoteSwiftPackageReference "swift-openapi-generator" */,
4D13AF602C482F1C00845FDB /* XCRemoteSwiftPackageReference "swift-openapi-runtime" */,
4D13AF632C482F4500845FDB /* XCRemoteSwiftPackageReference "swift-openapi-urlsession" */,
);
productRefGroup = 4D54C9292BF2608A001DE071 /* Products */;
projectDirPath = "";
Expand All @@ -449,6 +469,8 @@
4D39A4C82BF516B7003FA52E /* Localizable.xcstrings in Resources */,
4D54C9302BF2608F001DE071 /* Assets.xcassets in Resources */,
4D54C9342BF2608F001DE071 /* Preview Assets.xcassets in Resources */,
4D13AF692C482FE400845FDB /* openapi.yaml in Resources */,
4D13AF6B2C48301600845FDB /* openapi-generator-config.yaml in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -546,6 +568,10 @@
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
4D13AF672C482F5900845FDB /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
productRef = 4D13AF662C482F5900845FDB /* OpenAPIGenerator */;
};
4D54C93B2BF26090001DE071 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 4D54C9272BF2608A001DE071 /* Fyreplace */;
Expand Down Expand Up @@ -599,6 +625,9 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
FYREPLACE_API_URL_DEV = "https://dev.rest.api.fyreplace.app";
FYREPLACE_API_URL_LOCAL = "http://localhost:8080";
FYREPLACE_API_URL_MAIN = "https://rest.api.fyreplace.app";
FYREPLACE_PRIVACY_POLICY = "https://fyreplace.net/privacy-policy";
FYREPLACE_TERMS_OF_SERVICE = "https://fyreplace.net/terms-of-service";
FYREPLACE_WEBSITE = "https://fyreplace.net";
Expand Down Expand Up @@ -667,6 +696,9 @@
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
FYREPLACE_API_URL_DEV = "https://dev.rest.api.fyreplace.app";
FYREPLACE_API_URL_LOCAL = "";
FYREPLACE_API_URL_MAIN = "https://rest.api.fyreplace.app";
FYREPLACE_PRIVACY_POLICY = "https://fyreplace.net/privacy-policy";
FYREPLACE_TERMS_OF_SERVICE = "https://fyreplace.net/terms-of-service";
FYREPLACE_WEBSITE = "https://fyreplace.net";
Expand Down Expand Up @@ -877,7 +909,31 @@
repositoryURL = "https://github.com/getsentry/sentry-cocoa";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 8.28.0;
minimumVersion = 8.30.1;
};
};
4D13AF5F2C482F0100845FDB /* XCRemoteSwiftPackageReference "swift-openapi-generator" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/apple/swift-openapi-generator.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.2.1;
};
};
4D13AF602C482F1C00845FDB /* XCRemoteSwiftPackageReference "swift-openapi-runtime" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/apple/swift-openapi-runtime";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.4.0;
};
};
4D13AF632C482F4500845FDB /* XCRemoteSwiftPackageReference "swift-openapi-urlsession" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/apple/swift-openapi-urlsession";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.0.1;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand All @@ -888,6 +944,21 @@
package = 4D0DDC242C188869006CD503 /* XCRemoteSwiftPackageReference "sentry-cocoa" */;
productName = SentrySwiftUI;
};
4D13AF612C482F1C00845FDB /* OpenAPIRuntime */ = {
isa = XCSwiftPackageProductDependency;
package = 4D13AF602C482F1C00845FDB /* XCRemoteSwiftPackageReference "swift-openapi-runtime" */;
productName = OpenAPIRuntime;
};
4D13AF642C482F4500845FDB /* OpenAPIURLSession */ = {
isa = XCSwiftPackageProductDependency;
package = 4D13AF632C482F4500845FDB /* XCRemoteSwiftPackageReference "swift-openapi-urlsession" */;
productName = OpenAPIURLSession;
};
4D13AF662C482F5900845FDB /* OpenAPIGenerator */ = {
isa = XCSwiftPackageProductDependency;
package = 4D13AF5F2C482F0100845FDB /* XCRemoteSwiftPackageReference "swift-openapi-generator" */;
productName = "plugin:OpenAPIGenerator";
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 4D54C9202BF2608A001DE071 /* Project object */;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
{
"originHash" : "a72b37d142139a9f8de021ec1a2d4e7ec2a7ffc9ebc87493f58bac80a85691cb",
"originHash" : "e0840f1a8dc2d6b7e83730db4baa1bbb9b24ba7abed4fb6a17d608e1d406f1bd",
"pins" : [
{
"identity" : "openapikit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mattpolzin/OpenAPIKit",
"state" : {
"revision" : "33a9984b4af03f00e68b8ee85f1273cb826af04f",
"version" : "3.1.3"
}
},
{
"identity" : "sentry-cocoa",
"kind" : "remoteSourceControl",
Expand All @@ -9,6 +18,87 @@
"revision" : "5a601a24aa1b3fb29fcdb824633f050e08257e92",
"version" : "8.30.1"
}
},
{
"identity" : "swift-algorithms",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-algorithms",
"state" : {
"revision" : "f6919dfc309e7f1b56224378b11e28bab5bccc42",
"version" : "1.2.0"
}
},
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser",
"state" : {
"revision" : "0fbc8848e389af3bb55c182bc19ca9d5dc2f255b",
"version" : "1.4.0"
}
},
{
"identity" : "swift-collections",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections",
"state" : {
"revision" : "3d2dc41a01f9e49d84f0a3925fb858bed64f702d",
"version" : "1.1.2"
}
},
{
"identity" : "swift-http-types",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-http-types",
"state" : {
"revision" : "ae67c8178eb46944fd85e4dc6dd970e1f3ed6ccd",
"version" : "1.3.0"
}
},
{
"identity" : "swift-numerics",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-numerics.git",
"state" : {
"revision" : "0a5bc04095a675662cf24757cc0640aa2204253b",
"version" : "1.0.2"
}
},
{
"identity" : "swift-openapi-generator",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-openapi-generator.git",
"state" : {
"revision" : "7992d77065f2787e7651cf6d9be9b99ad38f5166",
"version" : "1.2.1"
}
},
{
"identity" : "swift-openapi-runtime",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-openapi-runtime",
"state" : {
"revision" : "9a8291fa2f90cc7296f2393a99bb4824ee34f869",
"version" : "1.4.0"
}
},
{
"identity" : "swift-openapi-urlsession",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-openapi-urlsession",
"state" : {
"revision" : "6efbfda5276bbbc8b4fec5d744f0ecd8c784eb47",
"version" : "1.0.1"
}
},
{
"identity" : "yams",
"kind" : "remoteSourceControl",
"location" : "https://github.com/jpsim/Yams",
"state" : {
"revision" : "3036ba9d69cf1fd04d433527bc339dc0dc75433d",
"version" : "5.1.3"
}
}
],
"version" : 3
Expand Down
Loading

0 comments on commit 9aa14bb

Please sign in to comment.