Skip to content

Commit 68e0c5b

Browse files
committed
重命名架构特定文件以支持多架构构建
1 parent 863de43 commit 68e0c5b

File tree

1 file changed

+39
-24
lines changed

1 file changed

+39
-24
lines changed

.github/workflows/release.yml

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ on:
44
workflow_dispatch:
55

66
jobs:
7-
7+
88
Compile:
99
name: Compile
1010
uses: ./.github/workflows/build.yml
11-
11+
1212
Release:
1313
name: Release
1414
needs: Compile
@@ -17,50 +17,65 @@ jobs:
1717
Artifacts_Path: .artifacts
1818

1919
steps:
20-
2120
- name: Download Artifacts
2221
uses: actions/download-artifact@v4
2322
with:
2423
merge-multiple: true
2524
path: ${{ env.Artifacts_Path }}
2625

26+
- name: Rename Architecture-Specific Files
27+
run: |
28+
$artifactsPath = "${{ env.Artifacts_Path }}"
29+
30+
# 重命名 x64 相关文件
31+
Get-ChildItem -Path $artifactsPath -Filter "*x64*.exe" | ForEach-Object {
32+
$newName = $_.FullName -replace "x64", "win-x64"
33+
Rename-Item -Path $_.FullName -NewName $newName
34+
}
35+
36+
# 重命名 arm64 相关文件
37+
Get-ChildItem -Path $artifactsPath -Filter "*arm64*.exe" | ForEach-Object {
38+
$newName = $_.FullName -replace "arm64", "win-arm64"
39+
Rename-Item -Path $_.FullName -NewName $newName
40+
}
41+
2742
- name: Generate Tag
2843
run: |
29-
$releases = (gh release list --repo Xcube-Studio/FluentLauncher.Preview.Installer --limit 100 | Measure-Object -Line).Lines
30-
31-
$major=1
32-
$minor=0
33-
$patch=0
44+
$releases = (gh release list --repo Xcube-Studio/FluentLauncher.Preview.Installer --limit 100 | Measure-Object -Line).Lines
45+
46+
$major=1
47+
$minor=0
48+
$patch=0
3449
35-
$patch += $releases % 12
36-
$minor += [math]::Floor($releases / 12)
37-
$major += [math]::Floor($minor / 6)
38-
$minor %= 6
50+
$patch += $releases % 12
51+
$minor += [math]::Floor($releases / 12)
52+
$major += [math]::Floor($minor / 6)
53+
$minor %= 6
3954
40-
$version="$major.$minor.$patch"
41-
echo "Generated version: $version"
42-
echo "version=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
55+
$version="$major.$minor.$patch"
56+
echo "Generated version: $version"
57+
echo "version=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
4358
4459
env:
4560
GH_TOKEN: ${{ github.token }}
4661

4762
- name: Create Release
4863
uses: ncipollo/[email protected]
4964
with:
50-
artifacts: "${{ env.Artifacts_Path }}\\*.*"
51-
allowUpdates: true
52-
generateReleaseNotes: true
53-
tag: "v${{ env.version }}"
54-
65+
artifacts: "${{ env.Artifacts_Path }}\\*.*"
66+
allowUpdates: true
67+
generateReleaseNotes: true
68+
tag: "v${{ env.version }}"
69+
5570
- name: Upload Files To Oss
5671
uses: xcube-studio/sync2oss@v2
5772
with:
5873
repoUrl: "Xcube-Studio/FluentLauncher.Preview.Installer"
5974
accessKeyId: ${{ secrets.ALIYUN_ACCESSKEYID }}
60-
accessKeySecret: ${{secrets.ALIYUN_ACCESSKEYSECRET}}
61-
endpoint: ${{secrets.ALIYUN_OSS_ENDPOINT}}
62-
bucketName: ${{secrets.ALIYUN_OSS_BUCKETNAME_1}}
75+
accessKeySecret: ${{ secrets.ALIYUN_ACCESSKEYSECRET }}
76+
endpoint: ${{ secrets.ALIYUN_OSS_ENDPOINT }}
77+
bucketName: ${{ secrets.ALIYUN_OSS_BUCKETNAME_1 }}
6378
region: "cn-shanghai"
6479
addSymlink: True
6580
fromRelease: True
66-
remoteDir: "FluentLauncher.Preview.Installer"
81+
remoteDir: "FluentLauncher.Preview.Installer"

0 commit comments

Comments
 (0)