mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-04-10 20:32:57 +08:00
Compare commits
2 Commits
v1.1.5-202
...
c3b8b1374a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c3b8b1374a | ||
|
|
7c940d6b15 |
92
.github/workflows/update-version-json.yml
vendored
92
.github/workflows/update-version-json.yml
vendored
@@ -74,64 +74,58 @@ jobs:
|
||||
|
||||
- name: Generate or update version.json
|
||||
run: |
|
||||
TAG_NAME="${{ steps.version.outputs.TAG_NAME }}"
|
||||
VERSION_ONLY="${{ steps.version.outputs.VERSION_ONLY }}"
|
||||
BUILD_DATE_ISO="${{ steps.version.outputs.BUILD_DATE_ISO }}"
|
||||
RELEASE_NAME_JSON="${{ steps.release_info.outputs.RELEASE_NAME }}"
|
||||
RELEASE_BODY_JSON="${{ steps.release_info.outputs.RELEASE_BODY }}"
|
||||
|
||||
# Default downloads structure
|
||||
DEFAULT_DOWNLOADS='{
|
||||
"windows-x64": {
|
||||
"url": "https://downloads.crossdesk.cn/crossdesk-win-x64-'${TAG_NAME}'.exe",
|
||||
"filename": "crossdesk-win-x64-'${TAG_NAME}'.exe"
|
||||
},
|
||||
"macos-x64": {
|
||||
"url": "https://downloads.crossdesk.cn/crossdesk-macos-x64-'${TAG_NAME}'.pkg",
|
||||
"filename": "crossdesk-macos-x64-'${TAG_NAME}'.pkg"
|
||||
},
|
||||
"macos-arm64": {
|
||||
"url": "https://downloads.crossdesk.cn/crossdesk-macos-arm64-'${TAG_NAME}'.pkg",
|
||||
"filename": "crossdesk-macos-arm64-'${TAG_NAME}'.pkg"
|
||||
},
|
||||
"linux-amd64": {
|
||||
"url": "https://downloads.crossdesk.cn/crossdesk-linux-amd64-'${TAG_NAME}'.deb",
|
||||
"filename": "crossdesk-linux-amd64-'${TAG_NAME}'.deb"
|
||||
},
|
||||
"linux-arm64": {
|
||||
"url": "https://downloads.crossdesk.cn/crossdesk-linux-arm64-'${TAG_NAME}'.deb",
|
||||
"filename": "crossdesk-linux-arm64-'${TAG_NAME}'.deb"
|
||||
}
|
||||
}'
|
||||
|
||||
# If version.json exists, try to preserve downloads section
|
||||
if [ -f version.json ] && jq -e '.downloads' version.json > /dev/null 2>&1; then
|
||||
EXISTING_DOWNLOADS=$(jq -c '.downloads' version.json)
|
||||
if [ "$EXISTING_DOWNLOADS" != "null" ] && [ "$EXISTING_DOWNLOADS" != "{}" ]; then
|
||||
DOWNLOADS="$EXISTING_DOWNLOADS"
|
||||
DOWNLOADS_JSON="$EXISTING_DOWNLOADS"
|
||||
else
|
||||
DOWNLOADS="$DEFAULT_DOWNLOADS"
|
||||
DOWNLOADS_JSON=""
|
||||
fi
|
||||
else
|
||||
DOWNLOADS="$DEFAULT_DOWNLOADS"
|
||||
DOWNLOADS_JSON=""
|
||||
fi
|
||||
|
||||
# Create version.json using jq for proper JSON formatting
|
||||
jq -n \
|
||||
--arg version "$VERSION_ONLY" \
|
||||
--arg releaseDate "$BUILD_DATE_ISO" \
|
||||
--argjson releaseName "$RELEASE_NAME_JSON" \
|
||||
--argjson releaseNotes "$RELEASE_BODY_JSON" \
|
||||
--arg tagName "$TAG_NAME" \
|
||||
--argjson downloads "$DOWNLOADS" \
|
||||
'{
|
||||
version: $version,
|
||||
releaseDate: $releaseDate,
|
||||
releaseName: $releaseName,
|
||||
releaseNotes: $releaseNotes,
|
||||
tagName: $tagName,
|
||||
downloads: $downloads
|
||||
}' > version.json
|
||||
# If downloads is empty, use default structure
|
||||
if [ -z "$DOWNLOADS_JSON" ]; then
|
||||
DOWNLOADS_JSON=$(cat << DOWNLOADS_EOF
|
||||
{
|
||||
"windows-x64": {
|
||||
"url": "https://downloads.crossdesk.cn/crossdesk-win-x64-${{ steps.version.outputs.TAG_NAME }}.exe",
|
||||
"filename": "crossdesk-win-x64-${{ steps.version.outputs.TAG_NAME }}.exe"
|
||||
},
|
||||
"macos-x64": {
|
||||
"url": "https://downloads.crossdesk.cn/crossdesk-macos-x64-${{ steps.version.outputs.TAG_NAME }}.pkg",
|
||||
"filename": "crossdesk-macos-x64-${{ steps.version.outputs.TAG_NAME }}.pkg"
|
||||
},
|
||||
"macos-arm64": {
|
||||
"url": "https://downloads.crossdesk.cn/crossdesk-macos-arm64-${{ steps.version.outputs.TAG_NAME }}.pkg",
|
||||
"filename": "crossdesk-macos-arm64-${{ steps.version.outputs.TAG_NAME }}.pkg"
|
||||
},
|
||||
"linux-amd64": {
|
||||
"url": "https://downloads.crossdesk.cn/crossdesk-linux-amd64-${{ steps.version.outputs.TAG_NAME }}.deb",
|
||||
"filename": "crossdesk-linux-amd64-${{ steps.version.outputs.TAG_NAME }}.deb"
|
||||
},
|
||||
"linux-arm64": {
|
||||
"url": "https://downloads.crossdesk.cn/crossdesk-linux-arm64-${{ steps.version.outputs.TAG_NAME }}.deb",
|
||||
"filename": "crossdesk-linux-arm64-${{ steps.version.outputs.TAG_NAME }}.deb"
|
||||
}
|
||||
}
|
||||
DOWNLOADS_EOF
|
||||
)
|
||||
fi
|
||||
|
||||
# Generate version.json using cat and heredoc
|
||||
cat > version.json << EOF
|
||||
{
|
||||
"version": "${{ steps.version.outputs.VERSION_ONLY }}",
|
||||
"releaseDate": "${{ steps.version.outputs.BUILD_DATE_ISO }}",
|
||||
"releaseName": ${{ steps.release_info.outputs.RELEASE_NAME }},
|
||||
"releaseNotes": ${{ steps.release_info.outputs.RELEASE_BODY }},
|
||||
"tagName": "${{ steps.version.outputs.TAG_NAME }}",
|
||||
"downloads": ${DOWNLOADS_JSON}
|
||||
}
|
||||
EOF
|
||||
|
||||
cat version.json
|
||||
|
||||
|
||||
@@ -315,10 +315,10 @@ Generation complete. Deployment files::
|
||||
Server certificate: crossdesk.cn_bundle.crt
|
||||
```
|
||||
|
||||
#### 服务端
|
||||
### 服务端
|
||||
将 **crossdesk.cn.key** 和 **crossdesk.cn_bundle.crt** 放置到 **/path/to/your/certs** 目录下。
|
||||
|
||||
#### 客户端
|
||||
### 客户端
|
||||
1. 点击右上角设置进入设置页面。<br>
|
||||
<img width="600" height="210" alt="image" src="https://github.com/user-attachments/assets/6431131d-b32a-4726-8783-6788f47baa3b" /><br><br>
|
||||
|
||||
@@ -331,5 +331,8 @@ Generation complete. Deployment files::
|
||||
7. 勾选使用**自托管服务器配置**,点击确认配置生效。<br><br>
|
||||
<img width="600" height="160" alt="image" src="https://github.com/user-attachments/assets/1e455dc3-4087-4f37-a544-1ff9f8789383" /><br><br>
|
||||
|
||||
### Web 客户端
|
||||
详情见项目 [CrossDesk Web Client](https://github.com/kunkundi/crossdesk-web-client)。
|
||||
|
||||
# 常见问题
|
||||
见 [常见问题](https://github.com/kunkundi/crossdesk/blob/self-hosted-server/docs/FAQ.md) 。
|
||||
|
||||
@@ -323,10 +323,10 @@ Generation complete. Deployment files::
|
||||
Server certificate: crossdesk.cn_bundle.crt
|
||||
```
|
||||
|
||||
#### Server Side
|
||||
### Server Side
|
||||
Place **crossdesk.cn.key** and **crossdesk.cn_bundle.crt** into the **/path/to/your/certs** directory.
|
||||
|
||||
#### Client Side
|
||||
### Client Side
|
||||
1. Click the settings icon in the top-right corner to enter the settings page.<br>
|
||||
<img width="600" height="210" alt="image" src="https://github.com/user-attachments/assets/6431131d-b32a-4726-8783-6788f47baa3b" /><br><br>
|
||||
|
||||
@@ -339,5 +339,8 @@ Place **crossdesk.cn.key** and **crossdesk.cn_bundle.crt** into the **/path/to/y
|
||||
4. Check the option to use **Self-Hosted Server Configuration**.<br><br>
|
||||
<img width="600" height="160" alt="image" src="https://github.com/user-attachments/assets/1e455dc3-4087-4f37-a544-1ff9f8789383" /><br><br>
|
||||
|
||||
### Web Client
|
||||
See [CrossDesk Web Client](https://github.com/kunkundi/crossdesk-web-client)。
|
||||
|
||||
# FAQ
|
||||
See [FAQ](https://github.com/kunkundi/crosssesk/blob/self-hosted-server/docs/FAQ.md) .
|
||||
|
||||
Reference in New Issue
Block a user