Skip to content
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
24 changes: 24 additions & 0 deletions .github/RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Releasing

Releases are automated with [release-please](https://github.com/googleapis/release-please).

1. Use [Conventional Commits](https://www.conventionalcommits.org/) for commit messages or squash-merge PR titles:
- `fix: …` creates a patch release (2.0.1)
- `feat: …` creates a minor release (2.1.0)
- `feat!: …`, or a `BREAKING CHANGE:` footer, creates a major release (3.0.0)
- `docs:`, `ci:`, `chore:`, `test:` and `refactor:` don't create a release
2. After each push to `master`, the **Release** workflow opens or updates a PR titled `chore(master): release X.Y.Z`. It updates `CHANGELOG.md` and `version.txt`.
3. Merging that PR creates the tag `X.Y.Z` (no `v` prefix, as Swift Package Manager expects) and a GitHub Release.

The first release is **2.0.0**. It's set by `initial-version` in `release-please-config.json` and by the `Release-As: 2.0.0` footer of the commit that added this automation.

To force a specific version, add a `Release-As: X.Y.Z` footer to a commit message.

## Required CI on release PRs

`master` requires status checks. GitHub doesn't run workflows for PRs that are created or updated with the default `GITHUB_TOKEN`. To have CI run automatically on release PRs, add a repository secret named `RELEASE_PLEASE_TOKEN`. It can be either:

- A fine-grained personal access token for this repository with **Contents: Read and write** and **Pull requests: Read and write** (add **Issues: Read and write** for labels).
- A GitHub App installation token with the same permissions.

Without the secret, the workflow falls back to `GITHUB_TOKEN`. The release PR is still created, but you have to start CI by hand: close and reopen the release PR.
44 changes: 44 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release

# Opens and updates a release PR from Conventional Commits merged into master.
# Merging that PR creates the SemVer tag (for example 2.0.0) and the GitHub Release.
# See .github/RELEASING.md.

on:
push:
branches: [master]
workflow_dispatch:

permissions:
contents: write
pull-requests: write
issues: write

concurrency:
group: release-please
cancel-in-progress: false

jobs:
release-please:
name: release-please
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
id: release
with:
# A PAT or GitHub App token is needed so the release PR triggers the required CI checks.
# Without it, the GITHUB_TOKEN fallback still works, but CI must be started by hand.
token: ${{ secrets.RELEASE_PLEASE_TOKEN || secrets.GITHUB_TOKEN }}
config-file: release-please-config.json
manifest-file: .release-please-manifest.json

- name: Warn if the release PR won't trigger CI
if: steps.release.outputs.prs_created == 'true' && env.HAS_TOKEN != 'true'
env:
HAS_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN != '' }}
run: |
echo "::warning::The release PR was created with GITHUB_TOKEN, so CI doesn't run on it. Add a RELEASE_PLEASE_TOKEN secret, or close and reopen the release PR to start CI. See .github/RELEASING.md."

- name: Summary
if: steps.release.outputs.release_created == 'true'
run: echo "Released ${{ steps.release.outputs.tag_name }}" >> "$GITHUB_STEP_SUMMARY"
1 change: 1 addition & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ A reference list of the system sounds built into iOS, plus a small demo app that
## Contents

- [Usage](#usage)
- [Swift Package Manager](#swift-package-manager)
- [Swift](#swift)
- [SwiftUI](#swiftui)
- [Objective-C](#objective-c)
Expand All @@ -30,6 +31,25 @@ A reference list of the system sounds built into iOS, plus a small demo app that

All examples use the `AudioToolbox` framework (System Sound Services). It is linked automatically when you import it in a modern Xcode project.

### Swift Package Manager

The `SystemSoundsLibrary` package wraps these sounds in a typed Swift 6 API with availability information (iOS 15+, tvOS, visionOS, Mac Catalyst). Add it in Xcode with **File > Add Package Dependencies…**, or in `Package.swift`:

```swift
dependencies: [
.package(url: "https://github.com/TUNER88/iOSSystemSoundsLibrary", from: "2.0.0"),
],
```

```swift
import SystemSoundsLibrary

SystemSoundPlayer.play(.smsReceived) // 1003
await SystemSoundPlayer.playAndWait(.mailReceived)
```

See [`Examples/SoundBrowser`](Examples/SoundBrowser) for a SwiftUI app that browses and plays every sound.

### Swift

Play a sound by its SystemSoundID:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ In Xcode, choose **File > Add Package Dependencies…** and enter

```swift
dependencies: [
.package(url: "https://github.com/TUNER88/iOSSystemSoundsLibrary", branch: "master"),
.package(url: "https://github.com/TUNER88/iOSSystemSoundsLibrary", from: "2.0.0"),
],
targets: [
.target(name: "MyApp", dependencies: [
Expand Down
13 changes: 13 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"release-type": "simple",
"include-v-in-tag": false,
"include-component-in-tag": false,
"packages": {
".": {
"package-name": "SystemSoundsLibrary",
"initial-version": "2.0.0",
"changelog-path": "CHANGELOG.md"
}
}
}
Loading