Skip to content

Commit 96d92b3

Browse files
committed
use tar instead of gzip by itself, and increase compression level
1 parent 7d0b1e7 commit 96d92b3

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Sources/unidoc-publish/Main.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,16 @@ extension AWS.S3.Client
5454
as path:String) async throws
5555
{
5656
let release:FilePath.Directory = scratch / "release"
57-
let executable:FilePath = release / name
58-
let compressed:FilePath = release / "\(name).gz"
57+
let archive:FilePath = release / "\(name).tar.gz"
5958

6059
print("Compressing \(name)...")
6160

62-
try SystemProcess.init(command: "gzip", "-kf", "\(executable)")()
63-
let file:[UInt8] = try compressed.read()
61+
try SystemProcess.init(command: "tar",
62+
"--use-compress-program='gzip -9'",
63+
"-C", "\(release)",
64+
"-cf", "\(archive)",
65+
name)()
66+
let file:[UInt8] = try archive.read()
6467

6568
try await self.connect
6669
{
@@ -72,7 +75,7 @@ extension AWS.S3.Client
7275
// These could be big files, even compressed, so we need to increase the timeout.
7376
try await $0.put(object: object,
7477
using: .standard,
75-
path: "\(path).gz",
78+
path: "\(path).tar.gz",
7679
with: key,
7780
timeout: .seconds(1200))
7881
}

0 commit comments

Comments
 (0)