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
3 changes: 2 additions & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -627,9 +627,10 @@ jobs:
}
}

const installer = (name) => /\.(dmg|deb|rpm|msi)$|-Setup\.exe$/.test(name);
const lines = [];
for (const a of assets) {
if (a.name === 'SHA256SUMS.txt') continue;
if (!installer(a.name)) continue;
const res = await github.request(
'GET /repos/{owner}/{repo}/releases/assets/{asset_id}',
{ owner, repo, asset_id: a.id, headers: { accept: 'application/octet-stream' } }
Expand Down
11 changes: 6 additions & 5 deletions src-tauri/src/updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ fn channels_for(version: &str) -> &'static [&'static str] {
}
}

/// Where a channel's two files live: stable, the latest release's assets;
/// beta, one fixed pre-release whose two files each beta replaces.
/// Where a channel's two files live: one fixed pre-release per channel,
/// whose two files each release of that channel replaces, so no release page
/// carries them (the page people download from shows the installers).
fn channel_base(channel: &str) -> String {
if channel == "beta" {
format!("{RELEASES}/download/proofpoll-beta")
} else {
format!("{RELEASES}/latest/download")
format!("{RELEASES}/download/proofpoll-stable")
}
}

Expand Down Expand Up @@ -475,8 +476,8 @@ mod tests {

#[test]
fn each_channel_reads_its_own_two_files() {
assert_eq!(latest_json_url("stable"), "https://github.com/WeAreFlowsta/ProofPoll/releases/latest/download/latest.json");
assert_eq!(manifest_url("stable"), "https://github.com/WeAreFlowsta/ProofPoll/releases/latest/download/release-manifest.json");
assert_eq!(latest_json_url("stable"), "https://github.com/WeAreFlowsta/ProofPoll/releases/download/proofpoll-stable/latest.json");
assert_eq!(manifest_url("stable"), "https://github.com/WeAreFlowsta/ProofPoll/releases/download/proofpoll-stable/release-manifest.json");
assert_eq!(manifest_url("beta"), "https://github.com/WeAreFlowsta/ProofPoll/releases/download/proofpoll-beta/release-manifest.json");
}

Expand Down
Loading