Swiftpack.co - SwiftPackageIndex/DocUploader as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by SwiftPackageIndex.
SwiftPackageIndex/DocUploader 1.6.0
AWS Lambda to upload doc sets to S3
⭐️ 1
🕓 7 weeks ago
.package(url: "https://github.com/SwiftPackageIndex/DocUploader.git", from: "1.6.0")


SwiftPackageIndex helper package to upload and process documentation bundles.

Doc Uploader

Dependencies for deployment

Install the following AWS tools to be able to deploy:

brew install awscli
brew tap aws/tap
brew install aws-sam-cli

Deployment also requires Docker for Mac.


aws configure

to set up the default credentials for deploying into AWS.

Subsequently, run either make deploy-test or make deploy-prod to deploy into the respective environment:

make deploy-test

Lambda operation notes


Release testing

There is currently no automated test setup to validate a new release, because it would be quite complex to set up.

Instead, use the dev environment to validate a new release as follows:

  • Run the tests
docker run --rm -v "$PWD":/host -w /host swift:5.8.0-amazonlinux2 swift test
  • Deploy the new version to the "test" lambda
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:
aws s3 cp dev-swiftpackageindex-semanticversion-0.3.6-356386b9.zip s3://spi-scratch-inbox/
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 for the given package (either by checking the timestamp or by deleting the version first and ensuring it re-appears).
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

Once a new release has been validated, push a new release as follows:

  • Tag the version
  • Run make deploy-prod

Installing and updating SAM


brew tap aws/tap
brew install aws-sam-cli


brew upgrade aws-sam-cli

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics