Skip to content

Commit c6d45bf

Browse files
committed
perf: change build
1 parent d7c8c0e commit c6d45bf

1 file changed

Lines changed: 10 additions & 26 deletions

File tree

.github/workflows/build.yml

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ on:
2121
- "v*" # 只有正式版本标签才触发构建
2222

2323
env:
24+
VERSION: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || github.ref_name }}
2425
XCODE_APP_TEAM_ID: ${{ secrets.XCODE_APP_TEAM_ID }}
2526
XCODE_APP_LOADER_EMAIL: ${{ secrets.XCODE_APP_LOADER_EMAIL }}
2627
XCODE_APP_LOADER_PASSWORD: ${{ secrets.XCODE_APP_LOADER_PASSWORD }}
@@ -71,45 +72,37 @@ jobs:
7172
- name: Check out git repository
7273
uses: actions/checkout@v4
7374

74-
- name: Set version
75-
id: set-version
76-
run: |
77-
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
78-
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
79-
else
80-
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
81-
fi
82-
8375
- name: Generate latest.json
76+
shell: bash
8477
run: |
8578
echo '{
86-
"version": "${{ steps.set-version.outputs.version }}",
87-
"notes": "Release ${{ steps.set-version.outputs.version }}",
79+
"version": "${{ env.VERSION }}",
80+
"notes": "Release ${{ env.VERSION }}",
8881
"pub_date": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'",
8982
"platforms": {
9083
"darwin-x86_64": {
9184
"signature": "",
92-
"url": "https://github.com/jumpserver/clients/releases/download/${{ steps.set-version.outputs.version }}/JumpServerClient_${{ steps.set-version.outputs.version }}_x86_64.dmg"
85+
"url": "https://github.com/jumpserver/clients/releases/download/${{ env.VERSION }}/JumpServerClient_${{ env.VERSION }}_x86_64.dmg"
9386
},
9487
"darwin-aarch64": {
9588
"signature": "",
96-
"url": "https://github.com/jumpserver/clients/releases/download/${{ steps.set-version.outputs.version }}/JumpServerClient_${{ steps.set-version.outputs.version }}_aarch64.dmg"
89+
"url": "https://github.com/jumpserver/clients/releases/download/${{ env.VERSION }}/JumpServerClient_${{ env.VERSION }}_aarch64.dmg"
9790
},
9891
"windows-x86_64": {
9992
"signature": "",
100-
"url": "https://github.com/jumpserver/clients/releases/download/${{ steps.set-version.outputs.version }}/JumpServerClient_${{ steps.set-version.outputs.version }}_x64.exe"
93+
"url": "https://github.com/jumpserver/clients/releases/download/${{ env.VERSION }}/JumpServerClient_${{ env.VERSION }}_x64.exe"
10194
},
10295
"windows-x86_64-msi": {
10396
"signature": "",
104-
"url": "https://github.com/jumpserver/clients/releases/download/${{ steps.set-version.outputs.version }}/JumpServerClient_${{ steps.set-version.outputs.version }}_x64.msi"
97+
"url": "https://github.com/jumpserver/clients/releases/download/${{ env.VERSION }}/JumpServerClient_${{ env.VERSION }}_x64.msi"
10598
}
10699
}
107100
}' > latest.json
108101
109102
- name: Upload latest.json to release
110103
uses: softprops/action-gh-release@v1
111104
with:
112-
tag_name: ${{ steps.set-version.outputs.version }}
105+
tag_name: ${{ env.VERSION }}
113106
files: latest.json
114107
fail_on_unmatched_files: true
115108
draft: true
@@ -176,15 +169,6 @@ jobs:
176169
- name: Install frontend dependencies
177170
run: pnpm install
178171

179-
- name: Set version
180-
id: set-version
181-
run: |
182-
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
183-
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
184-
else
185-
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
186-
fi
187-
188172
- name: Build Tauri app
189173
uses: tauri-apps/tauri-action@v0
190174
env:
@@ -193,7 +177,7 @@ jobs:
193177
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
194178

195179
with:
196-
tagName: ${{ steps.set-version.outputs.version }}
180+
tagName: ${{ env.VERSION }}
197181
releaseName: "JumpServer Client v__VERSION__"
198182
releaseBody: "See the assets to download this version and install."
199183
releaseDraft: true

0 commit comments

Comments
 (0)