Skip to content

Commit

Permalink
Merge pull request #17 from SwiftPackageIndex/package-update
Browse files Browse the repository at this point in the history
Package update
  • Loading branch information
finestructure committed Oct 20, 2023
2 parents b5562b8 + 2461e07 commit 340694f
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
tests:
runs-on: ubuntu-latest
container:
image: swift:5.8.0-amazonlinux2
image: swift:5.9.0-amazonlinux2
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
90 changes: 54 additions & 36 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/swift-server/async-http-client.git",
"state" : {
"revision" : "5b4f03de0600da906f9e46e9f636ec26218da080",
"version" : "1.16.0"
"revision" : "16f7e62c08c6969899ce6cc277041e868364e5cf",
"version" : "1.19.0"
}
},
{
"identity" : "combine-schedulers",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/combine-schedulers",
"state" : {
"revision" : "882ac01eb7ef9e36d4467eb4b1151e74fcef85ab",
"version" : "0.9.1"
"revision" : "9dc9cbe4bc45c65164fa653a563d8d8db61b09bb",
"version" : "1.0.0"
}
},
{
Expand All @@ -32,35 +32,35 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/soto-project/soto.git",
"state" : {
"revision" : "26bd91a43a3e569956b99b7f15aa2709a1a6ff23",
"version" : "6.5.0"
"revision" : "c28c3efa72e6beceae6f38f8c8fe18e7c57e3418",
"version" : "6.8.0"
}
},
{
"identity" : "soto-core",
"kind" : "remoteSourceControl",
"location" : "https://github.com/soto-project/soto-core.git",
"state" : {
"revision" : "787be995b0cff07bd28e9aea4c8a6424ead36e71",
"version" : "6.4.2"
"revision" : "3ed66ec536bc372360d7e3ec39a5e8b1870747ea",
"version" : "6.5.2"
}
},
{
"identity" : "soto-s3-file-transfer",
"kind" : "remoteSourceControl",
"location" : "https://github.com/soto-project/soto-s3-file-transfer.git",
"state" : {
"revision" : "78d655d4f811026dce90f065d5aa88946d7a1b1e",
"version" : "1.2.0"
"revision" : "da375d7544080e8f00dba3bb573d7a412f3c4b41",
"version" : "1.3.0"
}
},
{
"identity" : "swift-atomics",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-atomics.git",
"state" : {
"revision" : "6c89474e62719ddcc1e9614989fff2f68208fe10",
"version" : "1.1.0"
"revision" : "cd142fd2f64be2100422d658e7411e39489da985",
"version" : "1.2.0"
}
},
{
Expand All @@ -86,107 +86,125 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/swift-server/swift-backtrace.git",
"state" : {
"revision" : "f25620d5d05e2f1ba27154b40cafea2b67566956",
"version" : "1.3.3"
"revision" : "80746bdd0ac8a7d83aad5d89dac3cbf15de652e6",
"version" : "1.3.4"
}
},
{
"identity" : "swift-clocks",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-clocks",
"state" : {
"revision" : "20b25ca0dd88ebfb9111ec937814ddc5a8880172",
"version" : "0.2.0"
"revision" : "d1fd837326aa719bee979bdde1f53cd5797443eb",
"version" : "1.0.0"
}
},
{
"identity" : "swift-collections",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections.git",
"state" : {
"revision" : "937e904258d22af6e447a0b72c0bc67583ef64a2",
"version" : "1.0.4"
"revision" : "a902f1823a7ff3c9ab2fba0f992396b948eda307",
"version" : "1.0.5"
}
},
{
"identity" : "swift-concurrency-extras",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-concurrency-extras",
"state" : {
"revision" : "ea631ce892687f5432a833312292b80db238186a",
"version" : "1.0.0"
}
},
{
"identity" : "swift-crypto",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-crypto.git",
"state" : {
"revision" : "b51f1d6845b353a2121de1c6a670738ec33561a6",
"version" : "3.1.0"
}
},
{
"identity" : "swift-dependencies",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-dependencies.git",
"state" : {
"revision" : "615833420b3a01cec57530cae1287ee70dfdb77c",
"version" : "0.4.0"
"revision" : "4e1eb6e28afe723286d8cc60611237ffbddba7c5",
"version" : "1.0.0"
}
},
{
"identity" : "swift-log",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-log.git",
"state" : {
"revision" : "32e8d724467f8fe623624570367e3d50c5638e46",
"version" : "1.5.2"
"revision" : "532d8b529501fb73a2455b179e0bbb6d49b652ed",
"version" : "1.5.3"
}
},
{
"identity" : "swift-metrics",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-metrics.git",
"state" : {
"revision" : "e8bced74bc6d747745935e469f45d03f048d6cbd",
"version" : "2.3.4"
"revision" : "971ba26378ab69c43737ee7ba967a896cb74c0d1",
"version" : "2.4.1"
}
},
{
"identity" : "swift-nio",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio.git",
"state" : {
"revision" : "e0cc6dd6ffa8e6a6f565938acd858b24e47902d0",
"version" : "2.50.0"
"revision" : "3db5c4aeee8100d2db6f1eaf3864afdad5dc68fd",
"version" : "2.59.0"
}
},
{
"identity" : "swift-nio-extras",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-extras.git",
"state" : {
"revision" : "0e0d0aab665ff1a0659ce75ac003081f2b1c8997",
"version" : "1.19.0"
"revision" : "fb70a0f5e984f23be48b11b4f1909f3bee016178",
"version" : "1.19.1"
}
},
{
"identity" : "swift-nio-http2",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-http2.git",
"state" : {
"revision" : "38feec96bcd929028939107684073554bf01abeb",
"version" : "1.25.2"
"revision" : "9c22e4f810ce780453f563fba98e1a1039f83d56",
"version" : "1.28.1"
}
},
{
"identity" : "swift-nio-ssl",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-ssl.git",
"state" : {
"revision" : "9d0d5d8798a576fbf674a823734e65e15ca5f2ec",
"version" : "2.23.1"
"revision" : "320bd978cceb8e88c125dcbb774943a92f6286e9",
"version" : "2.25.0"
}
},
{
"identity" : "swift-nio-transport-services",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-transport-services.git",
"state" : {
"revision" : "59b966415dd336db6f388bbfe3fb43cfa549b981",
"version" : "1.16.0"
"revision" : "e7403c35ca6bb539a7ca353b91cc2d8ec0362d58",
"version" : "1.19.0"
}
},
{
"identity" : "xctest-dynamic-overlay",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
"state" : {
"revision" : "ab8c9f45843694dd16be4297e6d44c0634fd9913",
"version" : "0.8.4"
"revision" : "23cbf2294e350076ea4dbd7d5d047c1e76b03631",
"version" : "1.0.2"
}
},
{
Expand Down
31 changes: 24 additions & 7 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@

import PackageDescription


var linkerSettings: [LinkerSetting]? = nil
#if os(macOS)
// Fixes ld: warning: ignoring duplicate libraries: '-lz'
linkerSettings = [.unsafeFlags(["-Xlinker", "-no_warn_duplicate_libraries"])]
// Linux build fails with
// /usr/bin/ld.gold: fatal error: -pie and -static are incompatible
// if we include this settings
#endif

let package = Package(
name: "DocUploader",
platforms: [.macOS(.v12)],
Expand All @@ -24,20 +34,27 @@ let package = Package(
.library(name: "DocUploadBundle", targets: ["DocUploadBundle"])
],
dependencies: [
// NB: We include swift-crypto even though it's not a direct dependency to ensure we can build with
// --disable-automatic-resolution on all platforms.
.package(url: "https://github.com/apple/swift-crypto.git", from: "3.0.0"),
.package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", from: "0.1.0"),
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "1.0.0-alpha.1"),
.package(url: "https://github.com/soto-project/soto-s3-file-transfer.git", from: "1.2.0"),
.package(url: "https://github.com/marmelroy/Zip.git", from: "2.1.2"),
.package(url: "https://github.com/pointfreeco/swift-dependencies.git", from: "0.4.0")
.package(url: "https://github.com/pointfreeco/swift-dependencies.git", from: "1.0.0")
],
targets: [
.executableTarget(name: "Executable", dependencies: ["DocUploader"]),
.target(name: "DocUploader", dependencies: [
"DocUploadBundle",
.product(name: "AWSLambdaEvents", package: "swift-aws-lambda-events"),
.product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime"),
.product(name: "SotoS3FileTransfer", package: "soto-s3-file-transfer"),
]),
.target(
name: "DocUploader",
dependencies: [
"DocUploadBundle",
.product(name: "AWSLambdaEvents", package: "swift-aws-lambda-events"),
.product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime"),
.product(name: "SotoS3FileTransfer", package: "soto-s3-file-transfer"),
],
linkerSettings: linkerSettings
),
.target(name: "DocUploadBundle", dependencies: [
.product(name: "Zip", package: "Zip"),
.product(name: "Dependencies", package: "swift-dependencies")
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Deployment also requires [Docker for Mac](https://docs.docker.com/desktop/instal
Run

```
aws login
aws configure
```

to set up the default credentials for deploying into AWS.
Expand Down Expand Up @@ -55,13 +55,20 @@ make deploy-test
- Trigger a doc upload via the "test" lambda by downloading a `dev-` doc bundle from `spi-docs-inbox` and uploading it to `spi-scratch-inbox`:

```bash
❯ aws s3 cp s3://spi-docs-inbox/dev-swiftpackageindex-semanticversion-0.3.4-4e7b8a37.zip .
❯ aws s3 cp dev-swiftpackageindex-semanticversion-0.3.4-4e7b8a37.zip s3://spi-scratch-inbox/
aws s3 cp dev-swiftpackageindex-semanticversion-0.3.6-356386b9.zip s3://spi-scratch-inbox/
```

- Check the `DocUploaderLambda-Test` CloudWatch log group to confirm the new version has been triggered and processed the file without errors.
- Check the [`DocUploaderLambda-Test` CloudWatch log group](https://us-east-2.console.aws.amazon.com/cloudwatch/home?region=us-east-2#logsV2:log-groups/log-group/$252Faws$252Flambda$252FDocUploaderLambda-Test-UploadFunction-3D3w0QTh1l6H) to confirm the new version has been triggered and processed the file without errors.

- Verify docs updated in `spi-dev-docs` for the given package (either by checking the timestamp or by deleting the version first and ensuring it re-appears).
```bash
open 'https://us-east-2.console.aws.amazon.com/cloudwatch/home?region=us-east-2#logsV2:log-groups/log-group/$252Faws$252Flambda$252FDocUploaderLambda-Test-UploadFunction-3D3w0QTh1l6H'
```

- Verify docs updated in [`spi-dev-docs`](https://s3.console.aws.amazon.com/s3/buckets/spi-dev-docs?region=us-east-2&prefix=swiftpackageindex/semanticversion/0.3.6/&showversions=false) for the given package (either by checking the timestamp or by deleting the version first and ensuring it re-appears).

```bash
open 'https://s3.console.aws.amazon.com/s3/buckets/spi-dev-docs?region=us-east-2&prefix=swiftpackageindex/semanticversion/0.3.6/&showversions=false'
```

## Pushing a new release

Expand Down
4 changes: 2 additions & 2 deletions Sources/DocUploader/LiveS3Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import SotoS3FileTransfer
struct LiveS3Client: S3Client {
func deleteFile(client: AWSClient, logger: Logger, key: S3StoreKey) async throws {
let s3 = S3(client: client, region: .useast2)
let s3FileTransfer = S3FileTransferManager(s3: s3, threadPoolProvider: .createNew)
let s3FileTransfer = S3FileTransferManager(s3: s3, threadPoolProvider: .singleton)

guard let file = S3File(key: key) else {
throw Error(message: "Invalid key: \(key)")
Expand All @@ -30,7 +30,7 @@ struct LiveS3Client: S3Client {

func loadFile(client: AWSClient, logger: Logger, from key: S3StoreKey, to path: String) async throws {
let s3 = S3(client: client, region: .useast2)
let s3FileTransfer = S3FileTransferManager(s3: s3, threadPoolProvider: .createNew)
let s3FileTransfer = S3FileTransferManager(s3: s3, threadPoolProvider: .singleton)

guard let file = S3File(key: key) else {
throw Error(message: "Invalid key: \(key)")
Expand Down
2 changes: 1 addition & 1 deletion Tests/DocUploaderTests/DocUploaderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ final class DocUploaderTests: XCTestCase {
return .init(status: .noContent)
}
} operation: {
let client = HTTPClient(eventLoopGroupProvider: .createNew)
let client = HTTPClient(eventLoopGroupProvider: .singleton)
defer { try? client.syncShutdown() }
let status = try await DocReport.reportResult(
client: client,
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ docker run \
--rm \
--volume "$(pwd):/src" \
--workdir "/src" \
swift:5.8.0-amazonlinux2 \
swift:5.9.0-amazonlinux2 \
swift build --disable-automatic-resolution --product "$executable" -c release --static-swift-stdlib #-Xswiftc -cross-module-optimization

0 comments on commit 340694f

Please sign in to comment.