Compare commits

..

11 Commits

Author SHA1 Message Date
Bartosz Polaczyk f3832c31bd Merge pull request #55 from polac24/20220118-release-cocoapods-automatically
Release CocoaPods plugin automatically
2022-01-19 10:25:09 +01:00
Bartosz Polaczyk 6a7e6d1135 Add a section link 2022-01-18 21:55:17 +01:00
Bartosz Polaczyk da59c2a211 Document releasing to RubyGems 2022-01-18 21:51:16 +01:00
Bartosz Polaczyk eaba7f3c67 Publish to RubyGems 2022-01-18 21:46:27 +01:00
Bartosz Polaczyk bab3326175 Merge pull request #52 from polac24/20220116-cocoapods-plugin-release
Prepare Cocoapods plugin for a release
2022-01-17 12:21:07 +01:00
Bartosz Polaczyk dc0a82058b Bump plugin version 2022-01-16 12:56:46 +01:00
Bartosz Polaczyk c5c2732cc9 Expose prettify_meta_files and disable_certificate_verification to .rcinfo 2022-01-16 12:56:35 +01:00
Bartosz Polaczyk 46debcfa8a Merge pull request #51 from alekzernov/feature/ssl-cert-not-valid
Added a flag to disable checking the ssl certificate
2022-01-16 12:52:53 +01:00
Зернов Александр 3f6d3af5a5 code review. 2022-01-16 14:23:28 +03:00
Зернов Александр c42cb7ac55 fix hooks 2022-01-13 17:59:41 +03:00
Зернов Александр c65eccc5ee Add certificateVerification setting. 2022-01-13 15:22:06 +03:00
8 changed files with 89 additions and 6 deletions
+26
View File
@@ -44,3 +44,29 @@ jobs:
file_glob: true
tag: ${{ github.ref }}
overwrite: true
cocoapods:
name: Publish CocoaPods plugin
runs-on: ubuntu-latest
permissions:
contents: read
defaults:
run:
working-directory: cocoapods-plugin
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- run: bundle install
- name: Publish to RubyGems
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
CURRENT_VERSION=$(gem list cocoapods-xcremotecache --remote -q | sed 's/[^0-9\.]//g')
[ -f cocoapods-xcremotecache-$CURRENT_VERSION.gem ] && echo "Version $CURRENT_VERSION already exists" || gem push *.gem
env:
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
+8 -1
View File
@@ -45,6 +45,7 @@ _XCRemoteCache is a remote cache tool for Xcode projects. It reuses target artif
- [FAQ](#faq)
- [Development](#development)
- [Release](#release)
* [Releasing CocoaPods plugin](#releasing-cocoapods-plugin)
* [Building release package](#building-release-package)
- [Contributing](#contributing)
- [Code of conduct](#code-of-conduct)
@@ -310,7 +311,7 @@ _Note that for the `producer` mode, the prebuild build phase and `xccc`, `xcld`,
| `aws_region` | Region for AWS V4 Signature Authorization. E.g. `eu`. | `""` | ⬜️ |
| `aws_service` | Service for AWS V4 Signature Authorization. E.g. `storage`. | `""` | ⬜️ |
| `out_of_band_mappings` | A dictionary of files path remapping that should be applied to make it absolute path agnostic on a list of dependencies. Useful if a project refers files out of repo root, either compilation files or precompiled dependencies. Keys represent generic replacement and values are substrings that should be replaced. Example: for mapping `["COOL_LIBRARY": "/CoolLibrary"]` `/CoolLibrary/main.swift`will be represented as `$(COOL_LIBRARY)/main.swift`). Warning: remapping order is not-deterministic so avoid remappings with multiple matchings. | `[:]` | ⬜️ |
| `disable_certificate_verification` | A Boolean value that opts-in SSL certificate validation is disabled | `false` | ⬜️ |
## Backend cache server
@@ -421,6 +422,12 @@ Follow the [Development](docs/Development.md) guide. It has all the information
To release a version, in [Releases](https://github.com/spotify/XCRemoteCache/releases) draft a new release with `v0.3.0{-rc0}` tag format.
Packages with binaries will be automatically uploaded to the GitHub [Releases](https://github.com/spotify/XCRemoteCache/releases) page.
### Releasing CocoaPods plugin
Bump a gem version defined in [gem_version.rb](cocoapods-plugin/lib/cocoapods-xcremotecache/gem_version.rb) and create a new release described above.
A plugin is automatically uploaded to [RubyGems](https://rubygems.org/gems/cocoapods-xcremotecache) if a given version doesn't exist yet.
### Building release package
To build a release zip package for a single platform (e.g. `x86_64-apple-macosx`, `arm64-apple-macosx`), call:
@@ -129,6 +129,8 @@ public struct XCRemoteCacheConfig: Encodable {
/// `/CoolLibrary/main.swift`will be represented as `$(COOL_LIBRARY)/main.swift`).
/// Warning: remapping order is not-deterministic so avoid remappings with multiple matchings.
var outOfBandMappings: [String: String] = [:]
/// If true, SSL certificate validation is disabled
var disableCertificateVerification: Bool = false
}
extension XCRemoteCacheConfig {
@@ -180,6 +182,7 @@ extension XCRemoteCacheConfig {
merge.AWSRegion = scheme.AWSRegion ?? AWSRegion
merge.AWSService = scheme.AWSService ?? AWSService
merge.outOfBandMappings = scheme.outOfBandMappings ?? outOfBandMappings
merge.disableCertificateVerification = scheme.disableCertificateVerification ?? disableCertificateVerification
return merge
}
@@ -240,6 +243,7 @@ struct ConfigFileScheme: Decodable {
let AWSRegion: String?
let AWSService: String?
let outOfBandMappings: [String: String]?
let disableCertificateVerification: Bool?
// Yams library doesn't support encoding strategy, see https://github.com/jpsim/Yams/issues/84
enum CodingKeys: String, CodingKey {
@@ -283,6 +287,7 @@ struct ConfigFileScheme: Decodable {
case AWSRegion = "aws_region"
case AWSService = "aws_service"
case outOfBandMappings = "out_of_band_mappings"
case disableCertificateVerification = "disable_certificate_verification"
}
}
@@ -0,0 +1,32 @@
// Copyright (c) 2021 Spotify AB.
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
import Foundation
final class IgnoringCertificatesTrustManager: NSObject, URLSessionDelegate {
func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
guard let serverTrust = challenge.protectionSpace.serverTrust else {
completionHandler(.performDefaultHandling, nil)
return
}
let urlCredential = URLCredential(trust: serverTrust)
completionHandler(.useCredential, urlCredential)
}
}
@@ -36,6 +36,15 @@ class DefaultURLSessionFactory: URLSessionFactory {
let configuration = URLSessionConfiguration.default
configuration.httpAdditionalHeaders = config.requestCustomHeaders
configuration.timeoutIntervalForRequest = config.timeoutResponseDataChunksInterval
return URLSession(configuration: configuration)
switch config.disableCertificateVerification {
case true:
return URLSession(
configuration: configuration,
delegate: IgnoringCertificatesTrustManager(),
delegateQueue: nil
)
case false:
return URLSession(configuration: configuration)
}
}
}
+1
View File
@@ -53,6 +53,7 @@ An object that is passed to the `xcremotecache` can contain all properties suppo
| `xccc_file` | The path where should be placed the `xccc` binary (in the pod installation phase) | `{podfile_dir}/.rc/xccc` | ⬜️ |
| `remote_commit_file` | The path of the file with the remote commit sha (in the pod installation phase) | `{podfile_dir}/.rc/arc.rc`| ⬜️ |
| `prettify_meta_files` | A Boolean value that opts-in pretty JSON formatting for meta files | `false` | ⬜️ |
| `disable_certificate_verification` | A Boolean value that opts-in SSL certificate validation is disabled | `false` | ⬜️ |
## Uninstalling
@@ -29,6 +29,7 @@ module CocoapodsXCRemoteCacheModifier
LLDB_INIT_PATH = "#{ENV['HOME']}/.lldbinit"
FAT_ARCHIVE_NAME_INFIX = 'arm64-x86_64'
# List of plugins' user properties that should be copied to .rcinfo
CUSTOM_CONFIGURATION_KEYS = [
'enabled',
'xcrc_location',
@@ -37,7 +38,9 @@ module CocoapodsXCRemoteCacheModifier
'final_target',
'check_build_configuration',
'check_platform',
'modify_lldb_init'
'modify_lldb_init',
'prettify_meta_files',
'disable_certificate_verification'
]
class XCRemoteCache
@@ -59,7 +62,8 @@ module CocoapodsXCRemoteCacheModifier
'xccc_file' => "#{BIN_DIR}/xccc",
'remote_commit_file' => "#{BIN_DIR}/arc.rc",
'exclude_targets' => [],
'prettify_meta_files' => false
'prettify_meta_files' => false,
'disable_certificate_verification' => false
}
@@configuration.merge! default_values.select { |k, v| !@@configuration.key?(k) }
end
@@ -337,7 +341,6 @@ module CocoapodsXCRemoteCacheModifier
end
validate_configuration()
mode = @@configuration['mode']
xccc_location = @@configuration['xccc_file']
remote_commit_file = @@configuration['remote_commit_file']
@@ -13,5 +13,5 @@
# limitations under the License.
module CocoapodsXcremotecache
VERSION = "0.0.4"
VERSION = "0.0.5"
end