From 64b6438cfc23aa5a943cf040109cc91c19e04aed Mon Sep 17 00:00:00 2001 From: Thomas Zoechling Date: Mon, 2 Sep 2024 17:24:39 +0200 Subject: [PATCH 01/10] Update GitHub checkouts action usage --- .github/workflows/CI.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 03eb3390..64357d4d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -11,7 +11,7 @@ jobs: SwiftLint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: SwiftLint uses: norio-nomura/action-swiftlint@3.2.1 with: @@ -25,7 +25,7 @@ jobs: env: DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - run: swift -version - run: swift test -c release -Xswiftc -enable-testing @@ -37,13 +37,13 @@ jobs: container: image: swift:${{ matrix.tag }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - run: swift test -c release -Xswiftc -enable-testing Coverage: runs-on: macos-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - run: swift test -c release -Xswiftc -enable-testing --enable-code-coverage - run: find .build/release/codecov/ -name "*.profraw" -print0 | xargs -0 xcrun llvm-profdata merge -sparse -o .build/release/codecov/default.profdata - run: xcrun llvm-cov export -summary-only -ignore-filename-regex 'ZIPFoundationTests|resource_bundle_accessor.swift|.*Deprecated.*$' .build/release/ZIPFoundationPackageTests.xctest/Contents/MacOS/ZIPFoundationPackageTests -instr-profile .build/release/codecov/default.profdata > .build/coverage.json From 12539abf35f939caa9836bbb4cea99191c7b173f Mon Sep 17 00:00:00 2001 From: Thomas Zoechling Date: Mon, 2 Sep 2024 17:30:15 +0200 Subject: [PATCH 02/10] Whitespace --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2fa6e617..237d57bd 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ [![Platform](https://img.shields.io/badge/Platforms-macOS%20|%20iOS%20|%20tvOS%20|%20watchOS%20|%20visionOS%20|%20Linux-lightgrey.svg)](https://github.com/weichsel/ZIPFoundation) [![Twitter](https://img.shields.io/badge/twitter-@weichsel-blue.svg?style=flat)](http://twitter.com/weichsel) -ZIP Foundation is a library to create, read and modify ZIP archive files. -It is written in Swift and based on [Apple's libcompression](https://developer.apple.com/documentation/compression) for high performance and energy efficiency. +ZIP Foundation is a library to create, read and modify ZIP archive files. +It is written in Swift and based on [Apple's libcompression](https://developer.apple.com/documentation/compression) for high performance and energy efficiency. To learn more about the performance characteristics of the framework, you can read [this blog post](https://thomas.zoechling.me/journal/2017/07/ZIPFoundation.html). - [Features](#features) From a09f28b0dfc9cffd9a1ddbc538f25e4f9210caab Mon Sep 17 00:00:00 2001 From: Thomas Zoechling Date: Mon, 2 Sep 2024 17:32:47 +0200 Subject: [PATCH 03/10] Dummy commit --- Sources/ZIPFoundation/Archive.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/ZIPFoundation/Archive.swift b/Sources/ZIPFoundation/Archive.swift index 23b47664..f93de233 100644 --- a/Sources/ZIPFoundation/Archive.swift +++ b/Sources/ZIPFoundation/Archive.swift @@ -306,7 +306,7 @@ public final class Archive: Sequence { guard let locator: ZIP64EndOfCentralDirectoryLocator = Data.readStruct(from: file, at: locatorOffset), let record: ZIP64EndOfCentralDirectoryRecord = Data.readStruct(from: file, at: recordOffset) else { return nil - } + } return ZIP64EndOfCentralDirectory(record: record, locator: locator) } } From 33250db64ed6c11b5f79fc5b5116edef4d2911b5 Mon Sep 17 00:00:00 2001 From: Thomas Zoechling Date: Mon, 2 Sep 2024 17:33:12 +0200 Subject: [PATCH 04/10] Revert "Dummy commit" This reverts commit a09f28b0dfc9cffd9a1ddbc538f25e4f9210caab. --- Sources/ZIPFoundation/Archive.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/ZIPFoundation/Archive.swift b/Sources/ZIPFoundation/Archive.swift index f93de233..23b47664 100644 --- a/Sources/ZIPFoundation/Archive.swift +++ b/Sources/ZIPFoundation/Archive.swift @@ -306,7 +306,7 @@ public final class Archive: Sequence { guard let locator: ZIP64EndOfCentralDirectoryLocator = Data.readStruct(from: file, at: locatorOffset), let record: ZIP64EndOfCentralDirectoryRecord = Data.readStruct(from: file, at: recordOffset) else { return nil - } + } return ZIP64EndOfCentralDirectory(record: record, locator: locator) } } From f2741528d22f36e85ca7fbecb8d84c72f14b483f Mon Sep 17 00:00:00 2001 From: Thomas Zoechling Date: Mon, 2 Sep 2024 17:34:27 +0200 Subject: [PATCH 05/10] Reapply "Dummy commit" This reverts commit 33250db64ed6c11b5f79fc5b5116edef4d2911b5. --- Sources/ZIPFoundation/Archive.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/ZIPFoundation/Archive.swift b/Sources/ZIPFoundation/Archive.swift index 23b47664..f93de233 100644 --- a/Sources/ZIPFoundation/Archive.swift +++ b/Sources/ZIPFoundation/Archive.swift @@ -306,7 +306,7 @@ public final class Archive: Sequence { guard let locator: ZIP64EndOfCentralDirectoryLocator = Data.readStruct(from: file, at: locatorOffset), let record: ZIP64EndOfCentralDirectoryRecord = Data.readStruct(from: file, at: recordOffset) else { return nil - } + } return ZIP64EndOfCentralDirectory(record: record, locator: locator) } } From 0cb7cca525c1d0d5358debaa0a7c84be4a26de80 Mon Sep 17 00:00:00 2001 From: Thomas Zoechling Date: Mon, 2 Sep 2024 17:38:00 +0200 Subject: [PATCH 06/10] Use checkout@v3 for Linux job --- .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 64357d4d..19520096 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -37,7 +37,7 @@ jobs: container: image: swift:${{ matrix.tag }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - run: swift test -c release -Xswiftc -enable-testing Coverage: From 4413b42b19e281cdcc01f7a44d1eb004f263b28c Mon Sep 17 00:00:00 2001 From: Thomas Zoechling Date: Mon, 2 Sep 2024 17:38:15 +0200 Subject: [PATCH 07/10] Revert "Reapply "Dummy commit"" This reverts commit f2741528d22f36e85ca7fbecb8d84c72f14b483f. --- Sources/ZIPFoundation/Archive.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/ZIPFoundation/Archive.swift b/Sources/ZIPFoundation/Archive.swift index f93de233..23b47664 100644 --- a/Sources/ZIPFoundation/Archive.swift +++ b/Sources/ZIPFoundation/Archive.swift @@ -306,7 +306,7 @@ public final class Archive: Sequence { guard let locator: ZIP64EndOfCentralDirectoryLocator = Data.readStruct(from: file, at: locatorOffset), let record: ZIP64EndOfCentralDirectoryRecord = Data.readStruct(from: file, at: recordOffset) else { return nil - } + } return ZIP64EndOfCentralDirectory(record: record, locator: locator) } } From 8689cc058d29cd47f903e939aefc13339b8ee5ec Mon Sep 17 00:00:00 2001 From: Thomas Zoechling Date: Mon, 2 Sep 2024 17:39:16 +0200 Subject: [PATCH 08/10] Dummy commit --- Sources/ZIPFoundation/Archive.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Sources/ZIPFoundation/Archive.swift b/Sources/ZIPFoundation/Archive.swift index 23b47664..f20aca09 100644 --- a/Sources/ZIPFoundation/Archive.swift +++ b/Sources/ZIPFoundation/Archive.swift @@ -211,9 +211,7 @@ public final class Archive: Sequence { } #endif - deinit { - fclose(self.archiveFile) - } + deinit { fclose(self.archiveFile) } public func makeIterator() -> AnyIterator { let totalNumberOfEntriesInCD = self.totalNumberOfEntriesInCentralDirectory From 74d0ed0b87fcf6ba5b7996bfa6e331988a91ad90 Mon Sep 17 00:00:00 2001 From: Thomas Zoechling Date: Mon, 2 Sep 2024 17:48:39 +0200 Subject: [PATCH 09/10] Reduce Linux test matrix --- .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 19520096..249a1ace 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -32,12 +32,12 @@ jobs: Linux: strategy: matrix: - tag: ['5.1', '5.2', '5.3', '5.4', '5.5', '5.6', '5.7', '5.8', '5.9', '5.10'] + tag: ['5.7', '5.8', '5.9', '5.10'] runs-on: ubuntu-latest container: image: swift:${{ matrix.tag }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: swift test -c release -Xswiftc -enable-testing Coverage: From 464782ac63314b7cc5c49f65028ef79e4b859e76 Mon Sep 17 00:00:00 2001 From: Thomas Zoechling Date: Mon, 2 Sep 2024 17:49:21 +0200 Subject: [PATCH 10/10] Touch --- Sources/ZIPFoundation/Archive.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/ZIPFoundation/Archive.swift b/Sources/ZIPFoundation/Archive.swift index f20aca09..23b47664 100644 --- a/Sources/ZIPFoundation/Archive.swift +++ b/Sources/ZIPFoundation/Archive.swift @@ -211,7 +211,9 @@ public final class Archive: Sequence { } #endif - deinit { fclose(self.archiveFile) } + deinit { + fclose(self.archiveFile) + } public func makeIterator() -> AnyIterator { let totalNumberOfEntriesInCD = self.totalNumberOfEntriesInCentralDirectory