-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 63db911
Showing
9 changed files
with
202 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: API Check | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
API-Check: | ||
name: Diagnose API Breaking Changes | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- name: Checkout Source | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Mark Workspace As Safe | ||
# https://github.com/actions/checkout/issues/766 | ||
run: git config --global --add safe.directory ${GITHUB_WORKSPACE} | ||
- name: Diagnose API Breaking Changes | ||
run: | | ||
swift package diagnose-api-breaking-changes origin/main --products WebPush |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Test WebPush | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
Test-Release: | ||
name: "Test Release" | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- name: Checkout Source | ||
uses: actions/checkout@v3 | ||
- name: Build | ||
run: | | ||
swift build --build-tests --configuration release -Xswiftc -enable-testing -Xswiftc -warnings-as-errors -Xcc -Werror | ||
- name: Run Tests | ||
run: | | ||
swift test --skip-build --configuration release | ||
Test-Debug: | ||
name: "Test Debug" | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- name: Checkout Source | ||
uses: actions/checkout@v3 | ||
- name: Build | ||
run: | | ||
swift build --build-tests --configuration debug -Xswiftc -enable-testing -Xswiftc -warnings-as-errors -Xcc -Werror | ||
- name: Run Tests | ||
run: | | ||
swift test --skip-build --configuration debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.DS_Store | ||
/.build | ||
/Packages | ||
xcuserdata/ | ||
DerivedData/ | ||
.swiftpm/configuration/registries.json | ||
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata | ||
.netrc | ||
Package.resolved |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
version: 1 | ||
builder: | ||
configs: | ||
- documentation_targets: [WebPush] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Mochi Development, Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// swift-tools-version: 6.0 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "swift-webpush", | ||
platforms: [ | ||
.macOS(.v13), | ||
.iOS(.v15), | ||
.tvOS(.v15), | ||
.watchOS(.v8), | ||
], | ||
products: [ | ||
.library(name: "WebPush", targets: ["WebPush"]), | ||
], | ||
dependencies: [ | ||
], | ||
targets: [ | ||
.target( | ||
name: "WebPush", | ||
dependencies: [ | ||
] | ||
), | ||
.testTarget(name: "WebPushTests", dependencies: ["WebPush"]), | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# WebPush | ||
|
||
<p align="center"> | ||
<a href="https://swiftpackageindex.com/mochidev/WebPush"> | ||
<img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fmochidev%2FWebPush%2Fbadge%3Ftype%3Dswift-versions" /> | ||
</a> | ||
<a href="https://swiftpackageindex.com/mochidev/WebPush"> | ||
<img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fmochidev%2FWebPush%2Fbadge%3Ftype%3Dplatforms" /> | ||
</a> | ||
<a href="https://github.com/mochidev/WebPush/actions?query=workflow%3A%22Test+WebPush%22"> | ||
<img src="https://github.com/mochidev/WebPush/workflows/Test%20WebPush/badge.svg" alt="Test Status" /> | ||
</a> | ||
</p> | ||
|
||
A server-side Swift implementation of the WebPush standard. | ||
|
||
## Quick Links | ||
|
||
- [Documentation](https://swiftpackageindex.com/mochidev/WebPush/documentation) | ||
- [Updates on Mastodon](https://mastodon.social/tags/SwiftWebPush) | ||
|
||
## Installation | ||
|
||
Add `WebPush` as a dependency in your `Package.swift` file to start using it. Then, add `import WebPush` to any file you wish to use the library in. | ||
|
||
Please check the [releases](https://github.com/mochidev/WebPush/releases) for recommended versions. | ||
|
||
```swift | ||
dependencies: [ | ||
.package( | ||
url: "https://github.com/mochidev/WebPush.git", | ||
.upToNextMinor(from: "0.0.1") | ||
), | ||
], | ||
... | ||
targets: [ | ||
.target( | ||
name: "MyPackage", | ||
dependencies: [ | ||
"WebPush", | ||
] | ||
) | ||
] | ||
``` | ||
|
||
## Usage | ||
|
||
TBD | ||
|
||
## Contributing | ||
|
||
Contribution is welcome! Please take a look at the issues already available, or start a new discussion to propose a new feature. Although guarantees can't be made regarding feature requests, PRs that fit within the goals of the project and that have been discussed beforehand are more than welcome! | ||
|
||
Please make sure that all submissions have clean commit histories, are well documented, and thoroughly tested. **Please rebase your PR** before submission rather than merge in `main`. Linear histories are required, so merge commits in PRs will not be accepted. | ||
|
||
## Support | ||
|
||
To support this project, consider following [@dimitribouniol](https://mastodon.social/@dimitribouniol) on Mastodon, listening to Spencer and Dimitri on [Code Completion](https://mastodon.social/@codecompletion), or downloading Linh and Dimitri's apps: | ||
- [Not Phở](https://notpho.app/) | ||
- [Jiiiii](https://jiiiii.moe/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// | ||
// WebPushManager.swift | ||
// swift-webpush | ||
// | ||
// Created by Dimitri Bouniol on 2024-12-03. | ||
// Copyright © 2024 Mochi Development, Inc. All rights reserved. | ||
// | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// WebPushTests.swift | ||
// swift-webpush | ||
// | ||
// Created by Dimitri Bouniol on 2024-12-03. | ||
// Copyright © 2024 Mochi Development, Inc. All rights reserved. | ||
// | ||
|
||
|
||
import Testing | ||
@testable import WebPush | ||
|
||
@Test func example() async throws { | ||
// Write your test here and use APIs like `#expect(...)` to check expected conditions. | ||
} |