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
5 changes: 5 additions & 0 deletions .spi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: 1
builder:
configs:
- documentation_targets:
- ScreenUtil
9 changes: 3 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

> Pre-1.0; the public API is still changing.
## [1.0.0] - 2026-06-28

### Changed
- **Swift 6 language mode** (`swift-tools-version: 6.0`, `swiftLanguageModes: [.v6]`).
Expand Down Expand Up @@ -41,6 +39,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- One dependency: [apple/swift-atomics](https://github.com/apple/swift-atomics), used for the lock-free scale-factor snapshot.

### Notes
- Pre-1.0: no version has been tagged yet, and the public API is still changing.
The current state is the platform-isolated Swift 6 engine described above; the
next tagged release will become `1.0.0`.
- First tagged release. The platform-isolated Swift 6 engine described above is
the `1.0.0` public surface.
93 changes: 93 additions & 0 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Publishing ScreenUtil

How to cut a release of ScreenUtil to Swift Package Manager and Swift Package
Index. Run these yourself — they need your GitHub credentials.

## Channels at a glance

| Channel | Account needed | Mechanism |
|---------|----------------|-----------|
| Swift Package Manager | GitHub (repo admin) | git tag + GitHub Release |
| Swift Package Index | GitHub only | one-time PR to the package list |

## 0. Prepare accounts (one-time)

Do every box here **before** the first release. Tick each one off:

- [ ] **GitHub** — you already own `Dicky019/ScreenUtil` with push + Release rights. Nothing to set up. Optional: install the `gh` CLI (`brew install gh && gh auth login`) to cut Releases from the terminal.
- [ ] **Swift Package Index** — no separate account; it authenticates with GitHub. Registration is a one-time submission of your repo URL via the "Add a Package" form on swiftpackageindex.com (or a PR to https://github.com/SwiftPackageIndex/PackageList). Do this once; later tags are picked up automatically.

When both boxes are ticked you have every credential needed to publish — move on to the repo settings.

## 0b. Repo settings (one-time, GitHub "About" panel or API)

The repo's public metadata should match the package before you announce it.
Current state understates it (description says "iOS apps" only; license shows
"Other"). Fix via the repo's **About** gear on github.com, or the API below.

- [ ] **Description** → broaden beyond iOS:
> Thread-safe responsive screen adaptation for Apple platforms (iOS, macOS, tvOS, watchOS). Scale UI from a fixed design size to the real device. Inspired by flutter_screenutil.
- [ ] **Topics** → add `macos`, `tvos`, `watchos`, `screen-adaptation`, `swift-package-manager` (keep existing `ios`, `swift`, `swiftui`, `uikit`, `responsive-design`).
- [ ] **Website / homepage** → set to the Swift Package Index page once §3 is done: `https://swiftpackageindex.com/Dicky019/ScreenUtil`.
- [ ] **License badge** → confirm the repo sidebar shows **Apache-2.0** (not "Other"). The `LICENSE` file is already standard Apache-2.0; if it still reads "Other", re-touch and push the file so GitHub re-runs license detection.

Optional one-shot via API (needs the `gh` CLI authenticated):

```bash
gh repo edit Dicky019/ScreenUtil \
--description "Thread-safe responsive screen adaptation for Apple platforms (iOS, macOS, tvOS, watchOS). Scale UI from a fixed design size to the real device. Inspired by flutter_screenutil." \
--homepage "https://swiftpackageindex.com/Dicky019/ScreenUtil" \
--add-topic macos --add-topic tvos --add-topic watchos \
--add-topic screen-adaptation --add-topic swift-package-manager
```

## 1. Pre-flight checklist

- [ ] On `main`, working tree clean, latest pulled.
- [ ] `swift build` and `swift test` green (108 tests).
- [ ] `CHANGELOG.md` has a dated `## [1.0.0]` section.

```bash
swift build && swift test
```

## 2. Tag and GitHub Release (SPM)

SPM resolves straight from the git tag — tagging *is* the SPM release.

```bash
git tag -a 1.0.0 -m "ScreenUtil 1.0.0"
git push origin 1.0.0
```

Then create the GitHub Release from tag `1.0.0` (UI or `gh`):

```bash
gh release create 1.0.0 --title "1.0.0" --notes-from-tag
```

Paste the `CHANGELOG.md` 1.0.0 notes into the release body.

**Verify:** in a scratch dir, a package depending on `from: "1.0.0"` resolves:

```bash
mkdir /tmp/su-check && cd /tmp/su-check && swift package init --type executable
# add .package(url: "https://github.com/Dicky019/ScreenUtil", from: "1.0.0") then:
swift build
```

## 3. Swift Package Index

One-time: submit `https://github.com/Dicky019/ScreenUtil` via the Add-a-Package
form (or a PR to SwiftPackageIndex/PackageList). After that, SPI picks up new
tags automatically. `.spi.yml` already tells it to build docs for `ScreenUtil`.

**Verify:** the package page shows a green build matrix and the `1.0.0` version.

## 4. Post-release

Reopen the changelog for the next cycle — add at the top of `CHANGELOG.md`:

```markdown
## [Unreleased]
```
3 changes: 1 addition & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let package = Package(
)
],
dependencies: [
.package(url: "https://github.com/apple/swift-atomics.git", from: "1.2.0")
.package(url: "https://github.com/apple/swift-atomics.git", exact: "1.3.0")
],
targets: [
.target(
Expand All @@ -25,7 +25,6 @@ let package = Package(
.product(name: "Atomics", package: "swift-atomics")
],
path: "Sources/ScreenUtil",
exclude: ["Info.plist"],
resources: [
.copy("PrivacyInfo.xcprivacy")
],
Expand Down
53 changes: 0 additions & 53 deletions Sources/ScreenUtil/Info.plist

This file was deleted.

48 changes: 2 additions & 46 deletions Sources/ScreenUtil/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,12 @@
<plist version="1.0">
<dict>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryDiskSpace</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>
</array>
<array/>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyTracking</key>
<false/>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyCollectedDataTypesLinked</key>
<array/>
<key>NSPrivacyCollectedDataTypesPurposes</key>
<array/>
<key>NSPrivacyCollectedDataTypesTracking</key>
<array/>
<key>NSPrivacyAccessedAPITypesReasons</key>
<dict>
<key>CA92.1</key>
<string>This app uses this API to provide responsive screen adaptation functionality based on device characteristics and screen dimensions.</string>
</dict>
</dict>
</plist>
</plist>
Loading