Skip to content
Closed
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
55 changes: 54 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,36 @@ jobs:
choco install nsis.portable
makensis build/nsis/installer.nsi
mv build/nsis/PlumeInstaller.exe build/out/${{ env.BINARY_NAME }}-setup.exe

- name: Create AppCast
shell: pwsh
run: |
curl -L -o WinSparkle-0.8.1.zip https://github.com/vslavik/winsparkle/releases/download/v0.8.1/WinSparkle-0.8.1.zip
unzip WinSparkle-0.8.1.zip -d WinSparkle
"${{ secrets.SPARKLE_PRIV_KEY_WIN }}" | Out-File -Encoding ascii dsa_priv.pem
$SIGNATURE = ./WinSparkle/WinSparkle-0.8.1/bin/sign_update.bat build/out/${{ env.BINARY_NAME }}-setup.exe dsa_priv.pem
$VERSION = (Select-String '^version *= *' Cargo.toml | Select-Object -First 1).Line -replace 'version *= *"(.+)"','$1'
$DATE = Get-Date -Format "ddd, dd MMM yyyy HH:mm:ss K"
$xml = @"
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle">
<channel>
<title>PlumeImpactor</title>
<description>Most recent updates to PlumeImpactor</description>
<language>en</language>
<item>
<title>Version $VERSION</title>
<sparkle:version>$VERSION</sparkle:version>
<pubDate>$DATE</pubDate>
<enclosure url="https://github.com/khcrysalis/PlumeImpactor/releases/latest/download/${{ env.BINARY_NAME }}-setup.exe"
sparkle:dsaSignature="$SIGNATURE"
length="0"
type="application/octet-stream" />
</item>
</channel>
</rss>
"@
$xml | Out-File -Encoding utf8 build/out/appcast.xml

- name: Upload Bundles
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -209,6 +239,11 @@ jobs:
- name: Bundle
run: |
mkdir -p build/dmg
# Ensure Info.plist is valid before copying
plutil -lint package/macos/${{ env.BUNDLE_NAME }}.app/Contents/Info.plist
VERSION=$(grep '^version *= *' Cargo.toml | head -n1 | sed 's/version *= *"\(.*\)"/\1/')
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $VERSION" package/macos/${{ env.BUNDLE_NAME }}.app/Contents/Info.plist
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${{ github.run_number }}" package/macos/${{ env.BUNDLE_NAME }}.app/Contents/Info.plist
cp -R package/macos/${{ env.BUNDLE_NAME }}.app build/dmg/${{ env.BUNDLE_NAME }}.app
mkdir -p build/dmg/${{ env.BUNDLE_NAME }}.app/Contents/MacOS
mv build/universal/${{ env.BINARY_NAME }} build/dmg/${{ env.BUNDLE_NAME }}.app/Contents/MacOS/${{ env.BINARY_NAME }}
Expand All @@ -217,6 +252,12 @@ jobs:

- name: Codesign
run: |
codesign --deep --force --options runtime \
--sign "${{ secrets.DEV_ID_IDENTITY_NAME }}" build/dmg/${{ env.BUNDLE_NAME }}.app/Contents/Frameworks/Sparkle.framework/Resources/Autoupdate.app
codesign --deep --force --options runtime \
--sign "${{ secrets.DEV_ID_IDENTITY_NAME }}" build/dmg/${{ env.BUNDLE_NAME }}.app/Contents/Frameworks/Sparkle.framework
codesign --deep --force --options runtime \
--sign "${{ secrets.DEV_ID_IDENTITY_NAME }}" build/dmg/${{ env.BUNDLE_NAME }}.app/Contents/MacOS/${{ env.BINARY_NAME }}
codesign --deep --force --options runtime \
--sign "${{ secrets.DEV_ID_IDENTITY_NAME }}" build/dmg/${{ env.BUNDLE_NAME }}.app

Expand All @@ -239,8 +280,20 @@ jobs:
xcrun notarytool submit build/out/${{ env.BUNDLE_NAME }}.dmg --apple-id "${{ secrets.APPLE_ID_EMAIL }}" --password "${{ secrets.APPLE_ID_PASSWORD }}" --team-id "${{ secrets.APPLE_ID_TEAM }}" --wait
xcrun stapler staple build/out/${{ env.BUNDLE_NAME }}.dmg

- name: Setup Sparkle
id: get_version
run: |
curl -L -o Sparkle-2.8.1.tar.xz https://github.com/sparkle-project/Sparkle/releases/download/2.8.1/Sparkle-2.8.1.tar.xz
tar -xJf Sparkle-2.8.1.tar.xz
chmod +x ./bin/generate_appcast
echo ${{ secrets.SPARKLE_PRIV_KEY_MAC }} > sparkle_priv_key
./bin/generate_keys -f ./sparkle_priv_key
./bin/generate_appcast --download-url-prefix https://github.com/khcrysalis/PlumeImpactor/releases/latest/download/ build/out/

- name: Upload Universal DMG
uses: actions/upload-artifact@v4
with:
name: ${{ env.BINARY_NAME }}-macos-universal
path: build/out/${{ env.BUNDLE_NAME }}.dmg
path: |
build/out/${{ env.BUNDLE_NAME }}.dmg
build/out/appcast.xml
23 changes: 23 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions apps/plumeimpactor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ image = { version = "0.25.1", default-features = false, features = ["png"] }
rustls = { version = "0.23.32", features = ["ring"] }

keyring = { version = "3.6.3", default-features = false, features = ["windows-native", "apple-native", "linux-native"] }
sparkle-updater = { git = "https://github.com/PlumeImpactor/sparkle-updater", rev = "3d39e96", package = "sparkle-updater" }

[target.'cfg(target_os = "windows")'.build-dependencies]
embed-manifest = "1.4"
Expand Down
2 changes: 1 addition & 1 deletion apps/plumeimpactor/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn embed_windows_manifest(name: &str) {

{
let mut res = winres::WindowsResource::new();
res.set_icon("../../package/windows/icon.ico");
res.set_resource_file("../../package/windows/custom.rc");
res.compile().unwrap();
}
}
46 changes: 30 additions & 16 deletions apps/plumeimpactor/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@ use std::{
path::{Path, PathBuf}
};

use thiserror::Error as ThisError;
use sparkle_updater::Updater;

#[tokio::main]
async fn main() {
_ = rustls::crypto::ring::default_provider().install_default().unwrap();

#[cfg(any(target_os = "macos", target_os = "windows"))]
{
#[cfg(target_os = "macos")]
let updater = Updater::new();
#[cfg(target_os = "windows")]
let updater = Updater::new(
"https://github.com/khcrysalis/PlumeImpactor/releases/latest/download/appcast-win.xml".into(),
None,
);

updater.check_for_updates();
}

let _ = wxdragon::main(|_| {
frame::PlumeFrame::new().show();
});
}

use thiserror::Error as ThisError;

#[derive(Debug, ThisError)]
pub enum Error {
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("Plist error: {0}")]
Plist(#[from] plist::Error),
#[error("Idevice error: {0}")]
Idevice(#[from] idevice::IdeviceError),
#[error("Core error: {0}")]
Core(#[from] plume_core::Error),
#[error("Utils error: {0}")]
Utils(#[from] plume_utils::Error),
}

pub fn get_data_path() -> PathBuf {
let base = if cfg!(windows) {
env::var("APPDATA").unwrap()
Expand Down Expand Up @@ -71,3 +71,17 @@ pub fn get_mac_udid() -> Option<String> {
let udid = String::from_utf8_lossy(&output.stdout).trim().to_string();
(!udid.is_empty()).then_some(udid)
}

#[derive(Debug, ThisError)]
pub enum Error {
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("Plist error: {0}")]
Plist(#[from] plist::Error),
#[error("Idevice error: {0}")]
Idevice(#[from] idevice::IdeviceError),
#[error("Core error: {0}")]
Core(#[from] plume_core::Error),
#[error("Utils error: {0}")]
Utils(#[from] plume_utils::Error),
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?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>BuildMachineOSBuild</key>
<string>22D68</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Autoupdate</string>
<key>CFBundleIconFile</key>
<string>AppIcon.icns</string>
<key>CFBundleIdentifier</key>
<string>org.sparkle-project.Sparkle.Autoupdate</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.27.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>1.106</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>14C18</string>
<key>DTPlatformName</key>
<string>macosx</string>
<key>DTPlatformVersion</key>
<string>13.1</string>
<key>DTSDKBuild</key>
<string>22C55</string>
<key>DTSDKName</key>
<string>macosx13.1</string>
<key>DTXcode</key>
<string>1420</string>
<key>DTXcodeBuild</key>
<string>14C18</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSBackgroundOnly</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>10.9</string>
<key>LSUIElement</key>
<string>1</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
APPL????
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?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>BuildMachineOSBuild</key>
<string>22D68</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>Sparkle</string>
<key>CFBundleIdentifier</key>
<string>org.sparkle-project.Sparkle</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Sparkle</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.27.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>1.106</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>14C18</string>
<key>DTPlatformName</key>
<string>macosx</string>
<key>DTPlatformVersion</key>
<string>13.1</string>
<key>DTSDKBuild</key>
<string>22C55</string>
<key>DTSDKName</key>
<string>macosx13.1</string>
<key>DTXcode</key>
<string>1420</string>
<key>DTXcodeBuild</key>
<string>14C18</string>
<key>LSMinimumSystemVersion</key>
<string>10.9</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@media (prefers-color-scheme: dark) {
html {
color: white;
background: transparent;
}
:link {
color: #419CFF;
}
:link:active {
color: #FF1919;
}
}
Loading
Loading