Skip to content

Commit ddab26d

Browse files
committed
update workflow
1 parent 59709db commit ddab26d

2 files changed

Lines changed: 19 additions & 16 deletions

File tree

.github/workflows/main.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -93,23 +93,23 @@ jobs:
9393
9494
# 为 aarch64 生成 update.json
9595
SIGNATURE_AARCH64=$(cat "${DMG_AARCH64}.sig")
96-
echo '{
97-
"version": "${{ github.ref_name }}",
98-
"pub_date": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'",
99-
"url": "https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/MessAuto_${VERSION}_aarch64.dmg",
100-
"signature": "'$SIGNATURE_AARCH64'",
101-
"format": "app"
102-
}' > ./update-aarch64.json
96+
echo "{
97+
\"version\": \"${{ github.ref_name }}\",
98+
\"pub_date\": \"$(date -u +"%Y-%m-%dT%H:%M:%SZ")\",
99+
\"url\": \"https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/MessAuto_${VERSION}_aarch64.dmg\",
100+
\"signature\": \"$SIGNATURE_AARCH64\",
101+
\"format\": \"app\"
102+
}" > ./update-aarch64.json
103103
104104
# 为 x86_64 生成 update.json
105105
SIGNATURE_X86_64=$(cat "${DMG_X86_64}.sig")
106-
echo '{
107-
"version": "${{ github.ref_name }}",
108-
"pub_date": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'",
109-
"url": "https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/MessAuto_${VERSION}_x64.dmg",
110-
"signature": "'$SIGNATURE_X86_64'",
111-
"format": "app"
112-
}' > ./update-x86_64.json
106+
echo "{
107+
\"version\": \"${{ github.ref_name }}\",
108+
\"pub_date\": \"$(date -u +"%Y-%m-%dT%H:%M:%SZ")\",
109+
\"url\": \"https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/MessAuto_${VERSION}_x64.dmg\",
110+
\"signature\": \"$SIGNATURE_X86_64\",
111+
\"format\": \"app\"
112+
}" > ./update-x86_64.json
113113
114114
- name: Upload Release Assets
115115
run: |

src/updater.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use crate::notification;
22
use cargo_packager_updater::{Config, Update, check_update, semver::Version};
33
use log::{error, info};
4-
use std::thread;
54
use std::env;
5+
use std::thread;
66

77
fn get_current_arch() -> &'static str {
88
if cfg!(target_arch = "aarch64") {
@@ -16,7 +16,10 @@ fn get_current_arch() -> &'static str {
1616

1717
fn get_endpoint() -> String {
1818
let arch = get_current_arch();
19-
format!("https://github.com/LeeeSe/MessAuto/releases/latest/download/update-{}.json", arch)
19+
format!(
20+
"https://github.com/LeeeSe/MessAuto/releases/latest/download/update-{}.json",
21+
arch
22+
)
2023
}
2124

2225
const CURRENT_VERSION: &str = env!("CARGO_PKG_VERSION");

0 commit comments

Comments
 (0)