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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @on0t0le
11 changes: 6 additions & 5 deletions GitHubWidget/Services/GitHubService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ actor GitHubService: GitHubServiceProtocol {

private struct PRReview: Decodable {
let state: String
let user: GitHubUser
let user: GitHubUser?
}

private struct CheckRunsResponse: Decodable {
Expand All @@ -97,7 +97,7 @@ actor GitHubService: GitHubServiceProtocol {
let detail = try? JSONDecoder().decode(PRDetail.self, from: data) else {
return false
}
return !detail.requestedReviewers.isEmpty
return !detail.requestedReviewers.isEmpty || !detail.requestedTeams.isEmpty
}

func fetchEnrichments(prs: [PullRequest], token: String) async -> [Int: PREnrichment] {
Expand Down Expand Up @@ -128,10 +128,11 @@ actor GitHubService: GitHubServiceProtocol {

var latestByUser: [String: String] = [:]
for review in reviews {
guard let login = review.user?.login else { continue }
if review.state != "COMMENTED" {
latestByUser[review.user.login] = review.state
} else if latestByUser[review.user.login] == nil {
latestByUser[review.user.login] = review.state
latestByUser[login] = review.state
} else if latestByUser[login] == nil {
latestByUser[login] = review.state
}
}
let approved = latestByUser.values.filter { $0 == "APPROVED" }.count
Expand Down
34 changes: 7 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,40 +62,20 @@ xcodebuild archive \
-archivePath build/GitHubWidget.xcarchive \
ARCHS=arm64 \
ONLY_ACTIVE_ARCH=NO \
CODE_SIGN_IDENTITY="-"
CODE_SIGN_IDENTITY="-" \
SKIP_INSTALL=NO \
INSTALL_PATH=/Applications
```

`CODE_SIGN_IDENTITY="-"` signs ad-hoc (no Apple Developer account needed). For notarization, replace with your Developer ID identity.

### 3. Export the .app
`SKIP_INSTALL=NO` + `INSTALL_PATH=/Applications` are already set in `project.yml` — these flags are shown for clarity and can be omitted.

```bash
xcodebuild -exportArchive \
-archivePath build/GitHubWidget.xcarchive \
-exportPath build/export \
-exportOptionsPlist ExportOptions.plist
```

Create `ExportOptions.plist` in the repo root:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>mac-application</string>
<key>destination</key>
<string>export</string>
</dict>
</plist>
```

### 4. Package with pkgbuild
### 3. Package with pkgbuild

```bash
mkdir -p build/pkg-root/Applications
ditto build/export/GitHubWidget.app build/pkg-root/Applications/GitHubWidget.app
ditto build/GitHubWidget.xcarchive/Products/Applications/GitHubWidget.app build/pkg-root/Applications/GitHubWidget.app

pkgbuild \
--root build/pkg-root \
Expand All @@ -107,7 +87,7 @@ pkgbuild \

The `.pkg` installs `GitHubWidget.app` to `/Applications`.

### 5. (Optional) Sign and notarize
### 4. (Optional) Sign and notarize

Sign the package with a Developer ID Installer certificate:

Expand Down
2 changes: 2 additions & 0 deletions project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ targets:
ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
MARKETING_VERSION: "1.1.1"
CURRENT_PROJECT_VERSION: "1"
SKIP_INSTALL: NO
INSTALL_PATH: /Applications
info:
path: GitHubWidget/Info.plist
properties:
Expand Down