Skip to content

Instantly share code, notes, and snippets.

View litoarias's full-sized avatar
💭
I may be slow to respond.

Lito litoarias

💭
I may be slow to respond.
View GitHub Profile
@litoarias
litoarias / prepare_package.sh
Created February 7, 2022 14:05
Obtain checksum for binary target XCFramework
#!/bin/sh
# Check for arguments
if [ $# -eq 0 ]; then
echo "No arguments provided. First argument has to be version, e.g. '1.8.1'"
exit 1
fi
# 1. Get params
NEW_VERSION=$1
@litoarias
litoarias / Package.swift
Last active February 7, 2022 13:44
Binary target SPM
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let version = "1.0.0"
let moduleName = "NetworkModule"
let checksum = "8f42f67a0665798e1c4e149c73a36fb9dddc062bc90e3b4e077ea571613ddda1"
let package = Package(
@litoarias
litoarias / release_xcframework.sh
Last active February 9, 2024 11:37
Archive, make XCFramework, manage Github Release and distribute XCFramework
#!/bin/sh
# Check for arguments
if [ $# -eq 0 ]; then
echo "No arguments provided. First argument has to be version, e.g. '1.8.1', and second one the name of framework, e.g. 'NetworkModule'"
exit 1
fi
# Set properties
FRAMEWORK_VERSION=$1
@litoarias
litoarias / make_xcframework.sh
Created February 7, 2022 11:29
Generate XCFramework
xcodebuild -create-xcframework -output "framework_name_._xcframework" \
-framework "/path/to/framework/for/simulator/inide/archive" \
-framework "/path/to/framework/for/iOS/inide/archive"
@litoarias
litoarias / archive.sh
Last active February 6, 2022 23:01
Archive framework
xcodebuild archive -quiet \
-scheme {scheme_name} \
-sdk [ iphoneos | iphonesimulator | macosx MACOSX_DEPLOYMENT_TARGET=11.0 | ...] \
-archivePath {path_to_archvie} \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
SKIP_INSTALL=NO
default_platform(:ios)
import "Utils/Keychain.rb"
import "Utils/Git.rb"
import "Utils/Slack.rb"
import "Utils/Env.rb"
import "Lanes/Release.rb"
import "Lanes/Testflight.rb"
platform :ios do
@litoarias
litoarias / Release.rb
Created October 13, 2021 12:59
Deploy new release version and send it to app store connect
private_lane :private_release do | params |
begin
# Temporay keychain creation
ensure_temp_keychain(TEMP_KEYCHAIN_USER, TEMP_KEYCHAIN_PASSWORD)
# the semantic version added
type = params[:bump]
@litoarias
litoarias / Testflight.rb
Created October 13, 2021 12:51
Deploy new Testflight version
private_lane :private_beta do
begin
# Ensure that your git status is not dirty
ensure_git_status_clean
# increment build number
increment_build_number(xcodeproj: "#{APP_NAME}.xcodeproj")
@litoarias
litoarias / Slack.rb
Created October 13, 2021 12:11
Slack manager for Fastlane
def broadcast_message()
version = get_info_plist_value(
path: "#{APP_NAME}/Info.plist",
key: "CFBundleShortVersionString"
)
build = get_info_plist_value(
path: "#{APP_NAME}/Info.plist",
@litoarias
litoarias / Keychain.rb
Created October 13, 2021 12:08
Keychain manager for fastlane
def delete_temp_keychain(name)
delete_keychain(
name: name
) if File.exist? File.expand_path("~/Library/Keychains/#{name}-db")
end
def create_temp_keychain(name, password)
create_keychain(
name: name,