Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: readme and contrib #44

Merged
merged 17 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: On pull request
on:
pull_request:
branches: [main]

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- name: Commitlint and Other Shared Build Steps
uses: momentohq/standards-and-practices/github-actions/shared-build@gh-actions-v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

# - name: Verify README generation
# uses: momentohq/standards-and-practices/github-actions/oss-readme-template@gh-actions-v2
# with:
# project_status: official
# project_stability: alpha
# project_type: sdk
# sdk_language: Swift
# template_file: ./README.template.md
# output_file: ./README.md
# dev_docs_slug: swift

test:
uses: ./.github/workflows/test.yml
secrets:
auth-token: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
github-token: ${{ secrets.MOMENTO_MACHINE_USER_GITHUB_TOKEN }}
50 changes: 50 additions & 0 deletions .github/workflows/on-push-to-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: On push to main
on:
push:
branches: [main]

jobs:
readme:
runs-on: ubuntu-latest
steps:
- name: Setup repo
uses: actions/checkout@v3
with:
token: ${{ secrets.MOMENTO_MACHINE_USER_GITHUB_TOKEN }}

# - name: Generate README
# uses: momentohq/standards-and-practices/github-actions/generate-and-commit-oss-readme@gh-actions-v2
# with:
# project_status: official
# project_stability: alpha
# project_type: sdk
# sdk_language: Swift
# template_file: ./README.template.md
# output_file: ./README.md
# dev_docs_slug: swift

test:
needs: [readme]
uses: ./.github/workflows/test.yml
secrets:
auth-token: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
github-token: ${{ secrets.MOMENTO_MACHINE_USER_GITHUB_TOKEN }}

publish:
runs-on: ubuntu-latest
needs: test

steps:
- uses: google-github-actions/release-please-action@v3
name: Release Please
id: release
with:
token: ${{ secrets.MOMENTO_MACHINE_USER_GITHUB_TOKEN }}
release-type: simple
package-name: client-sdk-swift
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false}]'

- name: Publish
run: |
echo "Published version: ${{ steps.release.outputs.tag_name }}"
if: ${{ steps.release.outputs.release_created }}
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test

on:
workflow_call:
secrets:
auth-token:
description: "Auth token used for live testing"
required: true
github-token:
description: "Token for running Github actions"
required: true

jobs:
test:
# strategy:
# matrix:
# swift: ["5.4", "5.8"]
runs-on: ubuntu-latest
container: swift:5.8
env:
TEST_AUTH_TOKEN: ${{ secrets.auth-token }}
steps:
# - uses: swift-actions/setup-swift@65540b95f51493d65f5e59e97dcef9629ddf11bf
# with:
# swift-version: ${{ matrix.swift }}
- name: Setup repo
uses: actions/checkout@v3
with:
token: ${{ secrets.github-token }}

- name: Build
run: swift build

- name: Run test
run: swift test
27 changes: 27 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Welcome to client-sdk-swift contributing guide :wave:

Thank you for taking your time to contribute to our Swift SDK!
<br/>
This guide will provide you information to start your own development and testing.
<br/>
Happy coding :dancer:
<br/>

## Requirements :coffee:

- Swift version [5.4 or higher](https://www.swift.org/install/) is required
- A Momento API key is required, you can generate one using the [Momento Console](https://console.gomomento.com)

<br/>

## Examples

All examples are in subdirectories of `Examples`. We currently have a publish-and-subscribe example app in [Examples/topics](./Examples/topics) that demonstrates how to use the Momento Topic Client to both publish and subscribe to a topic. Note that, as detailed in the example app README, you'll need to create a cache called `my-cache` before running the app. You can use the [Momento Console](https://console.gomomento.com) to create the cache.

## Build :computer:

You can build the SDK using either `swift build` or `make build` from the root of the repository.

## Running tests

Coming soon
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 5.9
// swift-tools-version: 5.4
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand Down
44 changes: 43 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,43 @@
# client-sdk-swift
<head>
<meta name="Momento Go Client Library Documentation" content="Go client software development kit for Momento Cache">
</head>
<img src="https://docs.momentohq.com/img/logo.svg" alt="logo" width="400"/>

[![project status](https://momentohq.github.io/standards-and-practices/badges/project-status-official.svg)](https://github.com/momentohq/standards-and-practices/blob/main/docs/momento-on-github.md)
[![project stability](https://momentohq.github.io/standards-and-practices/badges/project-stability-alpha.svg)](https://github.com/momentohq/standards-and-practices/blob/main/docs/momento-on-github.md)

# Momento Swift SDK

To get started with Momento you will need a Momento API key. You can get one from the [Momento Console](https://console.gomomento.com).

* Website: [https://www.gomomento.com/](https://www.gomomento.com/)
* Momento Documentation: [https://docs.momentohq.com/](https://docs.momentohq.com/)
* Getting Started: [https://docs.momentohq.com/getting-started](https://docs.momentohq.com/getting-started)
* Discuss: [Momento Discord](https://discord.gg/3HkAKjUZGq)

## Packages

The Momento Swift SDK is available here on github: [momentohq/client-sdk-swift](https://github.com/momentohq/client-sdk-swift). Add the following to the `dependencies` section of your `Package.swift` file to include the SDK in your project:

```bash
.package(url: "https://github.com/momentohq/client-sdk-swift", exact: "0.2.0")
```

## Usage

Check out our [topics example](./Examples/topics/README.md) directory for a complete example of using the Momento Swift SDK to implement a publish and subscribe system.

## Getting Started and Documentation

General documentation on Momento and the Momento SDKs is available on the [Momento Docs website](https://docs.momentohq.com/). Specific usage examples for the Swift SDK will be available there as well soon!

## Examples

Check out full working code in the [topics example](./Examples/topics/README.md) directory of this repository!

## Developing

If you are interested in contributing to the SDK, please see the [CONTRIBUTING](./CONTRIBUTING.md) docs.

----------------------------------------------------------------------------------------
For more info, visit our website at [https://gomomento.com](https://gomomento.com)!
37 changes: 37 additions & 0 deletions README.template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{{ ossHeader }}

# Momento Swift SDK

To get started with Momento you will need a Momento API key. You can get one from the [Momento Console](https://console.gomomento.com).

* Website: [https://www.gomomento.com/](https://www.gomomento.com/)
* Momento Documentation: [https://docs.momentohq.com/](https://docs.momentohq.com/)
* Getting Started: [https://docs.momentohq.com/getting-started](https://docs.momentohq.com/getting-started)
* Discuss: [Momento Discord](https://discord.gg/3HkAKjUZGq)

## Packages

The Momento Swift SDK is available here on github: [momentohq/client-sdk-swift](https://github.com/momentohq/client-sdk-swift). Add the following to the `dependencies` section of your `Package.swift` file to include the SDK in your project:

```bash
.package(url: "https://github.com/momentohq/client-sdk-swift", exact: "0.2.0")
```

## Usage

Check out our [topics example](./Examples/topics/README.md) directory for a complete example of using the Momento Swift SDK to implement a publish and subscribe system.

## Getting Started and Documentation

General documentation on Momento and the Momento SDKs is available on the [Momento Docs website](https://docs.momentohq.com/). Specific usage exmaples for the Swift SDK will be available there as well soon!

## Examples

Check out full working code in the [topics example](./Examples/topics/README.md) directory of this repository!

## Developing

If you are interested in contributing to the SDK, please see the [CONTRIBUTING](./CONTRIBUTING.md) docs.

{{ ossFooter }}

55 changes: 0 additions & 55 deletions Tests/client-sdk-swiftTests/authTests.swift

This file was deleted.

Loading
Loading