9 Commits

Author SHA1 Message Date
dependabot[bot] 064aed35b6 Bump actions/checkout from 4 to 5 (#217)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-23 11:41:49 +02:00
Hannes Achleitner 0505abce23 Fix build with XCode 16 (#216) 2025-04-29 18:39:45 +02:00
Hannes Achleitner 89b08709e4 Use an arm64 runner for CI (#212) 2024-12-06 08:19:01 +01:00
Hannes Achleitner f4ba5cd328 Shell improvement (#215)
See https://github.com/koalaman/shellcheck/wiki/SC2086
2024-11-19 13:13:13 +01:00
Hannes Achleitner 20b46e76dd Fix compilation on macOS 10.13+ and Xcode 15 (#210)
https://github.com/SwiftGit2/SwiftGit2/pull/210#discussion_r1846442039
2024-11-18 13:26:07 +01:00
Hannes Achleitner 5eb09593a0 Rename matrix in CI (#207) 2023-11-29 20:32:58 +01:00
dependabot[bot] 6836608fca Bump actions/checkout from 3 to 4 (#202)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-17 16:55:16 +02:00
Artur Hellmann 67b2ee52e8 Loading all commits from a base, not only branch (#188)
--------

Co-authored-by: Artur Hellmann <artur.hellmann@aboalarm.de>
2023-10-17 16:51:58 +02:00
Hannes Achleitner a5a9656732 runGitHub action on pull request (#201) 2023-10-17 16:46:26 +02:00
11 changed files with 132 additions and 72 deletions
+11
View File
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
+45
View File
@@ -0,0 +1,45 @@
name: pull request
on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
xcode: [ Xcode_14.3, Xcode_15.2.0 ]
os: [ macos-13 ]
include:
- xcode: Xcode_15.4
os: macos-14
- xcode: Xcode_16.2
os: macos-14
steps:
- name: ls Xcode
run: ls -la /Applications/Xcode*
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: recursive
- name: get architecture
run: |
echo "ARCHITECTURE=$(uname -m)" >> $GITHUB_ENV
echo $(uname -m)
- name: Set XCode Version
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app
- name: schemes list
run: xcodebuild -workspace SwiftGit2.xcworkspace -list
- name: update_libgit2
run: script/update_libgit2
- name: bootstrap
run: script/bootstrap
# - name: cibuild
# run: script/cibuild
- name: Build project
run: xcodebuild -workspace SwiftGit2.xcworkspace -scheme SwiftGit2-OSX -archivePath ./SwiftGit2 archive ARCHS="${{ env.ARCHITECTURE }}"
-30
View File
@@ -1,30 +0,0 @@
language: objective-c
os: osx
osx_image: xcode11.4
sudo: false # Enable container-based builds
env:
matrix:
- SCHEME="SwiftGit2-OSX"
- SCHEME="SwiftGit2-iOS"
matrix:
fast_finish: true
before_install:
- gem update bundler # https://github.com/bundler/bundler/pull/4981
- gem install xcpretty
- gem install xcpretty-travis-formatter
install: script/bootstrap
script: script/cibuild
branches:
only: # whitelist
- master
notifications:
email: false
-1
View File
@@ -1 +0,0 @@
/usr/local/opt/openssl/lib/libcrypto.a
-1
View File
@@ -1 +0,0 @@
/usr/local/opt/openssl/lib/libssl.a
-1
View File
@@ -1,5 +1,4 @@
# SwiftGit2
[![Build Status](https://travis-ci.org/SwiftGit2/SwiftGit2.svg)](https://travis-ci.org/SwiftGit2/SwiftGit2)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](#carthage)
[![GitHub release](https://img.shields.io/github/release/SwiftGit2/SwiftGit2.svg)](https://github.com/SwiftGit2/SwiftGit2/releases)
![Swift 5.3.x](https://img.shields.io/badge/Swift-5.3.x-orange.svg)
+6 -6
View File
@@ -990,7 +990,7 @@
INSTALL_MODE_FLAG = "";
INSTALL_OWNER = "";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.13;
SWIFT_VERSION = 5.0;
};
name = Debug;
@@ -1006,7 +1006,7 @@
INSTALL_MODE_FLAG = "";
INSTALL_OWNER = "";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.13;
SWIFT_VERSION = 5.0;
};
name = Release;
@@ -1028,7 +1028,7 @@
OTHER_LDFLAGS = (
"-force_load",
"External/libgit2-mac/libgit2-mac.a",
/usr/local/lib/libssh2.a,
External/libssh2.a,
"-lgit2-mac",
"-lcrypto",
"-lssl",
@@ -1058,7 +1058,7 @@
OTHER_LDFLAGS = (
"-force_load",
"External/libgit2-mac/libgit2-mac.a",
/usr/local/lib/libssh2.a,
External/libssh2.a,
"-lgit2-mac",
"-lcrypto",
"-lssl",
@@ -1076,7 +1076,7 @@
baseConfigurationReference = BEB31F531A0D75EE00F525B9 /* macOS-Application.xcconfig */;
buildSettings = {
INFOPLIST_FILE = SwiftGit2Tests/Info.plist;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MACOSX_DEPLOYMENT_TARGET = 10.13;
PRODUCT_BUNDLE_IDENTIFIER = "org.libgit2.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
@@ -1087,7 +1087,7 @@
baseConfigurationReference = BEB31F531A0D75EE00F525B9 /* macOS-Application.xcconfig */;
buildSettings = {
INFOPLIST_FILE = SwiftGit2Tests/Info.plist;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MACOSX_DEPLOYMENT_TARGET = 10.13;
PRODUCT_BUNDLE_IDENTIFIER = "org.libgit2.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
+9 -1
View File
@@ -571,7 +571,15 @@ public final class Repository {
/// :param: branch The branch to get all commits from
/// :returns: Returns a result with array of branches or the error that occurred
public func commits(in branch: Branch) -> CommitIterator {
let iterator = CommitIterator(repo: self, root: branch.oid.oid)
return commits(from: branch.oid)
}
/// Load all commits from the given base in topological & time order descending
///
/// :param: base The oid to get all commits from
/// :returns: Returns a result with array of branches or the error that occurred
public func commits(from base: OID) -> CommitIterator {
let iterator = CommitIterator(repo: self, root: base.oid)
return iterator
}
+52 -24
View File
@@ -46,6 +46,7 @@ main ()
check_deps ()
{
echo "** check_deps **"
# Check if Homebrew is installed
which -s brew
local result=$?
@@ -56,13 +57,21 @@ check_deps ()
echo "Homebrew is not installed (http://brew.sh). You will need to manually ensure the following tools are installed:"
echo " $REQUIRED_TOOLS"
echo
echo "Additionally, the following libssh2 files must be symlinked under /usr/local:"
echo "Additionally, the following libssh2 files must be symlinked under /usr/local or /opt/homebrew :"
echo " lib/libssh2.a include/libssh2.h include/libssh2_sftp.h include/libssh2_publickey.h"
exit $result
if [ ! -z "$CI" ]
then
echo
echo "I will try to install brew now on the github runner"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
fi
# Ensure that we have libgit2's dependencies installed.
installed=`brew list`
installed=$(brew list)
for tool in $REQUIRED_TOOLS
do
@@ -71,6 +80,7 @@ check_deps ()
if [ "$code" -eq "0" ]
then
echo "*** $tool is available 👍"
continue
elif [ "$code" -ne "1" ]
then
@@ -81,27 +91,45 @@ check_deps ()
brew install "$tool"
done
brew_prefix=`brew --prefix`
expected_prefix=/usr/local
if [ "$brew_prefix" != "$expected_prefix" ]
then
echo "*** Adding soft links into $expected_prefix..."
products=(lib/libssh2.a include/libssh2.h include/libssh2_sftp.h include/libssh2_publickey.h)
for product in "${products[@]}"
do
destination="$expected_prefix/$product"
if [ -e "$destination" ]
then
continue
fi
sudo mkdir -p "$(dirname "$destination")"
sudo ln -s "$brew_prefix/$product" "$destination"
done
brew_prefix=$(brew --prefix)
if [[ $(uname -m) == 'arm64' ]]; then
echo "** Running on a Apple Silicon M1"
expected_prefix=/opt/homebrew
else
echo "** Running on a Apple x86"
expected_prefix=/usr/local
fi
install_path="./External"
pwd
set -x
cp "$brew_prefix"/lib/libcrypto.a $install_path
cp "$brew_prefix"/lib/libssl.a $install_path
cp "$brew_prefix"/lib/libssh2.a $install_path
set +x
if [ "$brew_prefix" != "$expected_prefix" ]
then
echo "*** Adding soft links into $expected_prefix..."
products=(lib/libssh2.a include/libssh2.h include/libssh2_sftp.h include/libssh2_publickey.h)
for product in "${products[@]}"
do
destination="$expected_prefix/$product"
if [ -e "$destination" ]
then
continue
fi
sudo mkdir -p "$(dirname "$destination")"
sudo ln -s "$brew_prefix/$product" "$destination"
done
fi
# openssl@1 is expected
#sslSource=$(find $brew_prefix -name libcrypto.a | grep openssl | sort | head -1 | xargs dirname)
#echo "Find libcrypto.a and take first $sslSource and copy to install_path=$install_path"
#cp $sslSource/* "$install_path" 2>/dev/null | echo "Copy and ignore subdirectory. This makes build work on x86 and arm64"
}
bootstrap_submodule ()
@@ -110,7 +138,7 @@ bootstrap_submodule ()
if [ -e "$bootstrap" ]
then
echo "*** Bootstrapping $name..."
echo "*** Bootstrapping ..."
"$bootstrap" >/dev/null
else
update_submodules
+2 -2
View File
@@ -57,7 +57,7 @@ if [ "$SCHEME" == "SwiftGit2-OSX" ]; then
xcodebuild -workspace "$XCWORKSPACE" \
-scheme "$SCHEME" \
${XCODE_OPTIONS[*]} \
"${XCODE_OPTIONS[*]}" \
build test \
2>&1 | xcpretty $XCPRETTY_FORMAT_OPTIONS
elif [ "$SCHEME" == "SwiftGit2-iOS" ]; then
@@ -80,7 +80,7 @@ elif [ "$SCHEME" == "SwiftGit2-iOS" ]; then
-scheme "$SCHEME" \
-destination "id=$DESTINATION_ID" \
-sdk iphonesimulator \
${XCODE_OPTIONS[*]} \
"${XCODE_OPTIONS[*]}" \
build test \
2>&1 | xcpretty $XCPRETTY_FORMAT_OPTIONS
fi
+7 -6
View File
@@ -5,18 +5,19 @@ set -e
# augment path to help it find cmake installed in /usr/local/bin,
# e.g. via brew. Xcode's Run Script phase doesn't seem to honor
# ~/.MacOSX/environment.plist
PATH="/usr/local/bin:$PATH"
if [[ `uname -m` == 'arm64' ]]; then
echo "** Running on a Apple Silicon M1"
PATH="/opt/homebrew/bin:$PATH"
else
echo "** Running on a Apple x86"
PATH="/usr/local/bin:$PATH"
fi
SCRIPT_DIR=$(dirname "$0")
source "${SCRIPT_DIR}/xcode_functions.sh"
function setup_build_environment ()
{
# augment path to help it find cmake installed in /usr/local/bin,
# e.g. via brew. Xcode's Run Script phase doesn't seem to honor
# ~/.MacOSX/environment.plist
PATH="/usr/local/bin:$PATH"
pushd "$SCRIPT_DIR/.." > /dev/null
ROOT_PATH="$PWD"
popd > /dev/null