Skip to content

Commit

Permalink
Add Documentation and a Swift Package Index Setup (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
PSchmiedmayer authored Jan 14, 2023
1 parent e79de90 commit c065a04
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .spi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# This source file is part of the TemplatePackage open source project
#
# SPDX-FileCopyrightText: 2022 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#

version: 1
builder:
configs:
- platform: ios
documentation_targets:
- TemplatePackage
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The template repository contains a template Swift Package, including a continuou
2. If your Swift Package does not provide any user interface or does not require an iOS application environment to function, you can remove the `UITests` application from the `Tests` folder. You need to update the `build-and-test.yml` GitHub Action accordingly by removing the GitHub Action that builds and tests the application, removing the dependency from the code coverage upload step, and removing the UI test `.xresult` input from the code coverage test.
3. You will either need to add the [CodeCov GitHub App](https://github.com/apps/codecov) or add a codecov.io token to your [GitHub Actions Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-an-environment) following the instructions of the [Codecov GitHub Action](https://github.com/marketplace/actions/codecov#usage). The StanfordBDHG organization already has the [CodeCov GitHub App](https://github.com/apps/codecov) installed. If you do not want to cover test coverage data, you can remove the code coverage job in the `build-and-test.yml` GitHub Action.
4. Adjust this README to describe your project and adjust the badges at the top to point to the correct GitHub Action of your repository and Codecov badge.
5. The Swift Package template includes a Swift Package Index configuration file to automatically build the package and [host the documentation on the Swift Package Index website](https://blog.swiftpackageindex.com/posts/auto-generating-auto-hosting-and-auto-updating-docc-documentation/). Adjust the `.spi.yml` file to include all targets that you want to build documentation for. You can follow the [instructions of the Swift Package Index](https://swiftpackageindex.com/add-a-package) to include your Swift Package in the Swift Package Index.


## Installation
Expand Down
23 changes: 23 additions & 0 deletions Sources/TemplatePackage/TemplatePackage.docc/TemplatePackage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# ``TemplatePackage``

<!--
#
# This source file is part of the TemplatePackage open source project
#
# SPDX-FileCopyrightText: 2022 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#
-->

The template repository contains a template Swift Package, including a continuous integration setup.

## Overview

Please follow the steps in the README.md file to customize the code to your needs.

## Types

### Template Package

- ``TemplatePackage``
6 changes: 4 additions & 2 deletions Sources/TemplatePackage/TemplatePackage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
// SPDX-License-Identifier: MIT
//

struct TemplatePackage {
var stanford: String {
/// The main type of the Swift Package template.
public struct TemplatePackage {
/// The Swift Package template package is provided by Stanford University.
public var stanford: String {
"Stanford University"
}
}

0 comments on commit c065a04

Please sign in to comment.