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
31 changes: 29 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,25 @@ jobs:
hdiutil create -volname rtaudio -srcfolder dmg_temp -ov -format UDZO rtaudio.dmg
rm -rf dmg_temp

- name: Download and extract Sparkle
run: |
cd /tmp
curl -L https://github.com/sparkle-project/Sparkle/releases/download/2.9.0/Sparkle-2.9.0.tar.xz | tar xJ

- name: Generate Sparkle appcast
run: |
echo "${{ secrets.SPARKLE_PRIVATE_KEY }}" | /tmp/bin/generate_appcast \
--ed-key-file - \
-o appcast.xml \
./rtaudio.dmg

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: rtaudio-release
path: rtaudio.dmg
path: |
rtaudio.dmg
appcast.xml
retention-days: 1

release:
Expand Down Expand Up @@ -87,6 +101,17 @@ jobs:
# expose short SHA for use in the release name/tag
echo "short_sha=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_OUTPUT

- name: Push appcast to rtaudio-updater repo
run: |
git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository_owner }}/rtaudio-updater.git updater
cp artifacts/appcast.xml updater/appcast.xml
cd updater
git config user.email "action@github.com"
git config user.name "GitHub Action"
git add appcast.xml
git commit -m "Update appcast for release-${{ steps.commit_msg.outputs.short_sha }}" || true
git push

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
Expand All @@ -95,4 +120,6 @@ jobs:
target_commitish: ${{ github.sha }}
name: "🔖 Release #${{ steps.commit_msg.outputs.short_sha }}"
body: ${{ steps.commit_msg.outputs.msg }}
files: artifacts/rtaudio.dmg
files: |
artifacts/rtaudio.dmg
artifacts/appcast.xml
25 changes: 25 additions & 0 deletions rtaudio.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
264F33942F64499800C1E2AB /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = 264F33932F64499800C1E2AB /* Sparkle */; };
266C88832F605EEB00139B20 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 266C88822F605EEB00139B20 /* Accelerate.framework */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -42,6 +43,7 @@
buildActionMask = 2147483647;
files = (
266C88832F605EEB00139B20 /* Accelerate.framework in Frameworks */,
264F33942F64499800C1E2AB /* Sparkle in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -93,6 +95,7 @@
);
name = rtaudio;
packageProductDependencies = (
264F33932F64499800C1E2AB /* Sparkle */,
);
productName = rtaudio;
productReference = 266C88662F605B8600139B20 /* rtaudio.app */;
Expand Down Expand Up @@ -123,6 +126,9 @@
);
mainGroup = 266C885D2F605B8600139B20;
minimizedProjectReferenceProxies = 1;
packageReferences = (
264F33922F64499800C1E2AB /* XCRemoteSwiftPackageReference "Sparkle" */,
);
preferredProjectObjectVersion = 77;
productRefGroup = 266C88672F605B8600139B20 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -399,6 +405,25 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
264F33922F64499800C1E2AB /* XCRemoteSwiftPackageReference "Sparkle" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/sparkle-project/Sparkle";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 2.9.0;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
264F33932F64499800C1E2AB /* Sparkle */ = {
isa = XCSwiftPackageProductDependency;
package = 264F33922F64499800C1E2AB /* XCRemoteSwiftPackageReference "Sparkle" */;
productName = Sparkle;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 266C885E2F605B8600139B20 /* Project object */;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions rtaudio/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import AVFAudio
import Cocoa
internal import MetalKit
import simd
import Sparkle

func getAppleMusicArtwork() -> NSImage? {
let script = """
Expand Down Expand Up @@ -164,6 +165,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate {
var panel: NSPanel!
let audioTap = AudioTap()
var metalView: WaveformMTKView!
private var updaterController: SPUStandardUpdaterController!

let width: CGFloat = 135
let height: CGFloat = 60
Expand All @@ -186,7 +188,13 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate {
app.run()
}

@objc func checkForUpdates() {
updaterController.checkForUpdates(nil)
}

func applicationDidFinishLaunching(_ notification: Notification) {
updaterController = SPUStandardUpdaterController(
startingUpdater: true, updaterDelegate: nil, userDriverDelegate: nil)
// Create the actual app panel
panel = NSPanel(
contentRect: NSRect(x: 0, y: 0, width: width, height: height),
Expand Down
5 changes: 5 additions & 0 deletions rtaudio/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@
<true />
<key>NSAudioCaptureUsageDescription</key>
<string>This app needs to capture system audio for displaying the waveform.</string>
<key>SUFeedURL</key>
<string>
https://raw.githubusercontent.com/ZephyrCodesStuff/rtaudio-updater/refs/heads/main/appcast.xml</string>
<key>SUPublicEDKey</key>
<string>cqFRi1a5mwPMBGu47gW01S0FwPsQJapmeHQuq4cnXL0=</string>
</dict>
</plist>
9 changes: 9 additions & 0 deletions rtaudio/Views/WaveformMTKView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,15 @@ class WaveformMTKView: NSView, CAMetalDisplayLinkDelegate {
resetItem.target = NSApp.delegate
menu.addItem(resetItem)

menu.addItem(NSMenuItem.separator())
let updateItem = NSMenuItem(
title: "Check for Updates...",
action: #selector(AppDelegate.checkForUpdates),
keyEquivalent: ""
)
updateItem.target = NSApp.delegate
menu.addItem(updateItem)

menu.addItem(NSMenuItem.separator())
menu.addItem(
NSMenuItem(
Expand Down
Loading