From 88985ad52fe75c30cad7456c4fa75d5405901c49 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Thu, 25 Jan 2024 18:50:16 -0500 Subject: [PATCH 01/12] [CocoaPods] Add podspec --- leveldb-library.podspec | 61 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 leveldb-library.podspec diff --git a/leveldb-library.podspec b/leveldb-library.podspec new file mode 100644 index 0000000000..827110701a --- /dev/null +++ b/leveldb-library.podspec @@ -0,0 +1,61 @@ +Pod::Spec.new do |s| + s.name = 'leveldb-library' + s.version = '1.22.3' + s.license = 'New BSD' + s.summary = 'A fast key-value storage library ' + s.description = 'LevelDB is a fast key-value storage library written at Google that provides ' + + 'an ordered mapping from string keys to string values.' + s.homepage = 'https://github.com/google/leveldb' + s.authors = 'The LevelDB Authors' + + s.ios.deployment_target = '11.0' + s.osx.deployment_target = '10.13' + s.tvos.deployment_target = '11.0' + s.watchos.deployment_target = '6.0' + + s.source = { + :git => 'https://github.com/firebase/leveldb.git', + :tag => s.version.to_s + } + + s.requires_arc = false + + s.pod_target_xcconfig = { + 'GCC_PREPROCESSOR_DEFINITIONS' => 'LEVELDB_IS_BIG_ENDIAN=0 ' + + 'LEVELDB_PLATFORM_POSIX ' + + 'HAVE_FULLFSYNC=1', + 'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}"', + + # Disable warnings introduced by Xcode 8.3 and Xcode 9 + # The deprecated-declarations is for OSMemoryBarrier on tvOS + 'WARNING_CFLAGS' => '-Wno-shorten-64-to-32 -Wno-comma -Wno-unreachable-code ' + + '-Wno-conditional-uninitialized -Wno-deprecated-declarations', + + # Prevent naming conflicts between leveldb headers and system headers + 'USE_HEADERMAP' => 'No', + } + + s.header_dir = "leveldb" + s.source_files = [ + "db/*.{cc,h}", + "port/*.{cc,h}", + "table/*.{cc,h}", + "util/*.{cc,h}", + "include/leveldb/*.h" + ] + + s.public_header_files = [ + "include/leveldb/*.h" + ] + + s.exclude_files = [ + "**/*_test.cc", + "**/*_bench.cc", + "db/leveldbutil.cc", + "util/env_windows.cc", + "util/testutil.cc" + ] + + s.library = 'c++' +end + From fd4a366d4044e2ca8cfa007ac0059baf14910746 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Thu, 25 Jan 2024 19:47:01 -0500 Subject: [PATCH 02/12] Attempt to set up a pod lib lint workflow --- .github/workflows/spm.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/spm.yml b/.github/workflows/spm.yml index a761f213b0..d0318d0bf4 100644 --- a/.github/workflows/spm.yml +++ b/.github/workflows/spm.yml @@ -11,3 +11,14 @@ jobs: - uses: actions/checkout@v2 - name: Build run: swift build + + cocoapods: + strategy: + matrix: + platform: [ios] + # platform: [ios, tvos, macos, watchos] + runs-on: macOS-latest + steps: + - uses: actions/checkout@v2 + - name: Build + run: pod lib lint leveldb-library.podspec --platforms=${{ matrix.platform }} --no-clean --skip-import-validation From bbea625812cf635de5d40439ea0066431d7da4db Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Thu, 25 Jan 2024 19:50:24 -0500 Subject: [PATCH 03/12] Lint across all platforms --- .github/workflows/spm.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/spm.yml b/.github/workflows/spm.yml index d0318d0bf4..744a300945 100644 --- a/.github/workflows/spm.yml +++ b/.github/workflows/spm.yml @@ -15,8 +15,7 @@ jobs: cocoapods: strategy: matrix: - platform: [ios] - # platform: [ios, tvos, macos, watchos] + platform: [ios, tvos, macos, watchos] runs-on: macOS-latest steps: - uses: actions/checkout@v2 From 7849fb5d0c9d2d6fa16bc585470d9b1d23be5902 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Thu, 25 Jan 2024 19:54:13 -0500 Subject: [PATCH 04/12] Remove unneeded flag and add clarifying comment --- .github/workflows/spm.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/spm.yml b/.github/workflows/spm.yml index 744a300945..f56ec0376d 100644 --- a/.github/workflows/spm.yml +++ b/.github/workflows/spm.yml @@ -20,4 +20,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Build - run: pod lib lint leveldb-library.podspec --platforms=${{ matrix.platform }} --no-clean --skip-import-validation + # Some header files import C++ headers, which causes linting failures + # (https://github.com/CocoaPods/CocoaPods/issues/5152). As a + # workaround, the `--skip-import-validation` is used. + run: pod lib lint leveldb-library.podspec --platforms=${{ matrix.platform }} --skip-import-validation From 1c5d44aa0fd82c80d8f82747ecb6b5850747f6b4 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Thu, 25 Jan 2024 19:56:14 -0500 Subject: [PATCH 05/12] Add job cancellation optimization --- .github/workflows/spm.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/spm.yml b/.github/workflows/spm.yml index f56ec0376d..294ae337e4 100644 --- a/.github/workflows/spm.yml +++ b/.github/workflows/spm.yml @@ -4,6 +4,10 @@ on: push: pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + jobs: swift-build-run: runs-on: macOS-latest From 5a197255c14a5f677d619129d34e1c009518d7c2 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Thu, 25 Jan 2024 19:56:44 -0500 Subject: [PATCH 06/12] Rename workflow file to be more general --- .github/workflows/{spm.yml => ci.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{spm.yml => ci.yml} (100%) diff --git a/.github/workflows/spm.yml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/spm.yml rename to .github/workflows/ci.yml From 061746267546242fd81cb444ac51f9ea8c05652a Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Thu, 25 Jan 2024 19:57:40 -0500 Subject: [PATCH 07/12] Change name of workflow --- .github/workflows/ci.yml | 2 +- .github/workflows/spm.yml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/spm.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 294ae337e4..0839295c20 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: spm +name: ci on: push: diff --git a/.github/workflows/spm.yml b/.github/workflows/spm.yml new file mode 100644 index 0000000000..0839295c20 --- /dev/null +++ b/.github/workflows/spm.yml @@ -0,0 +1,30 @@ +name: ci + +on: + push: + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + swift-build-run: + runs-on: macOS-latest + steps: + - uses: actions/checkout@v2 + - name: Build + run: swift build + + cocoapods: + strategy: + matrix: + platform: [ios, tvos, macos, watchos] + runs-on: macOS-latest + steps: + - uses: actions/checkout@v2 + - name: Build + # Some header files import C++ headers, which causes linting failures + # (https://github.com/CocoaPods/CocoaPods/issues/5152). As a + # workaround, the `--skip-import-validation` is used. + run: pod lib lint leveldb-library.podspec --platforms=${{ matrix.platform }} --skip-import-validation From 5d2fda52176350e600f5e5191583c29c851e723f Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Thu, 25 Jan 2024 20:00:02 -0500 Subject: [PATCH 08/12] Fix to 80 line chars --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0839295c20..01e5af9539 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,4 +27,7 @@ jobs: # Some header files import C++ headers, which causes linting failures # (https://github.com/CocoaPods/CocoaPods/issues/5152). As a # workaround, the `--skip-import-validation` is used. - run: pod lib lint leveldb-library.podspec --platforms=${{ matrix.platform }} --skip-import-validation + run: | + pod lib lint leveldb-library.podspec \ + --platforms=${{ matrix.platform }} \ + --skip-import-validation From 388046ccfa6f3be468d40a1d9de60337d06e5fe5 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Thu, 25 Jan 2024 20:01:46 -0500 Subject: [PATCH 09/12] Remove old workflow file --- .github/workflows/spm.yml | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 .github/workflows/spm.yml diff --git a/.github/workflows/spm.yml b/.github/workflows/spm.yml deleted file mode 100644 index 0839295c20..0000000000 --- a/.github/workflows/spm.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: ci - -on: - push: - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} - cancel-in-progress: true - -jobs: - swift-build-run: - runs-on: macOS-latest - steps: - - uses: actions/checkout@v2 - - name: Build - run: swift build - - cocoapods: - strategy: - matrix: - platform: [ios, tvos, macos, watchos] - runs-on: macOS-latest - steps: - - uses: actions/checkout@v2 - - name: Build - # Some header files import C++ headers, which causes linting failures - # (https://github.com/CocoaPods/CocoaPods/issues/5152). As a - # workaround, the `--skip-import-validation` is used. - run: pod lib lint leveldb-library.podspec --platforms=${{ matrix.platform }} --skip-import-validation From acfff76c2d80370b37f5c6bbca0d38cb198ec423 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Thu, 25 Jan 2024 20:44:21 -0500 Subject: [PATCH 10/12] Change job name: swift-build-run -> spm --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01e5af9539..f028a4968f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ concurrency: cancel-in-progress: true jobs: - swift-build-run: + spm: runs-on: macOS-latest steps: - uses: actions/checkout@v2 From 7a12194dfb2c2e5d616a1e5d26330596e8b483f4 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Thu, 25 Jan 2024 20:45:19 -0500 Subject: [PATCH 11/12] Use 'CocoaPods-' prefix for tagging strategy --- leveldb-library.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/leveldb-library.podspec b/leveldb-library.podspec index 827110701a..c11c5dcf4f 100644 --- a/leveldb-library.podspec +++ b/leveldb-library.podspec @@ -15,7 +15,7 @@ Pod::Spec.new do |s| s.source = { :git => 'https://github.com/firebase/leveldb.git', - :tag => s.version.to_s + :tag => 'CocoaPods-' + s.version.to_s } s.requires_arc = false From ce029bb02bc8d1e122238571350df9cc4a69716e Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Thu, 25 Jan 2024 20:57:02 -0500 Subject: [PATCH 12/12] Fix CI warnings --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f028a4968f..b9a5228796 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: spm: runs-on: macOS-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build run: swift build @@ -22,7 +22,7 @@ jobs: platform: [ios, tvos, macos, watchos] runs-on: macOS-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build # Some header files import C++ headers, which causes linting failures # (https://github.com/CocoaPods/CocoaPods/issues/5152). As a