Skip to content

Commit a925b4d

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

File tree

1 file changed

+47
-25
lines changed

1 file changed

+47
-25
lines changed

.github/workflows/release.yml

Lines changed: 47 additions & 25 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,72 @@ jobs:
1717
Artifacts_Path: .artifacts
1818

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

25+
- name: Rename and Merge Artifacts
26+
run: |
27+
$artifactsPath = "${{ env.Artifacts_Path }}"
28+
29+
# 遍历 artifacts 目录,根据目录名称为文件添加架构标识
30+
Get-ChildItem -Path $artifactsPath -Directory | ForEach-Object {
31+
$artifactDir = $_.FullName
32+
$dirName = $_.Name
33+
34+
if ($dirName -match "CommandLineInstaller-win-x64") {
35+
Rename-Item -Path "$artifactDir\\CommandLineInstaller.exe" `
36+
-NewName "$artifactsPath\\CommandLineInstaller-win-x64.exe"
37+
} elseif ($dirName -match "CommandLineInstaller-win-arm64") {
38+
Rename-Item -Path "$artifactDir\\CommandLineInstaller.exe" `
39+
-NewName "$artifactsPath\\CommandLineInstaller-win-arm64.exe"
40+
} elseif ($dirName -match "UniversalInstaller-win-x64") {
41+
Rename-Item -Path "$artifactDir\\UniversalInstaller.exe" `
42+
-NewName "$artifactsPath\\UniversalInstaller-win-x64.exe"
43+
} elseif ($dirName -match "UniversalInstaller-win-arm64") {
44+
Rename-Item -Path "$artifactDir\\UniversalInstaller.exe" `
45+
-NewName "$artifactsPath\\UniversalInstaller-win-arm64.exe"
46+
}
47+
}
48+
2749
- name: Generate Tag
2850
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
51+
$releases = (gh release list --repo Xcube-Studio/FluentLauncher.Preview.Installer --limit 100 | Measure-Object -Line).Lines
52+
53+
$major=1
54+
$minor=0
55+
$patch=0
3456
35-
$patch += $releases % 12
36-
$minor += [math]::Floor($releases / 12)
37-
$major += [math]::Floor($minor / 6)
38-
$minor %= 6
57+
$patch += $releases % 12
58+
$minor += [math]::Floor($releases / 12)
59+
$major += [math]::Floor($minor / 6)
60+
$minor %= 6
3961
40-
$version="$major.$minor.$patch"
41-
echo "Generated version: $version"
42-
echo "version=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
62+
$version="$major.$minor.$patch"
63+
echo "Generated version: $version"
64+
echo "version=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
4365
4466
env:
4567
GH_TOKEN: ${{ github.token }}
4668

4769
- name: Create Release
4870
uses: ncipollo/[email protected]
4971
with:
50-
artifacts: "${{ env.Artifacts_Path }}\\*.*"
51-
allowUpdates: true
52-
generateReleaseNotes: true
53-
tag: "v${{ env.version }}"
54-
72+
artifacts: "${{ env.Artifacts_Path }}\\*.*"
73+
allowUpdates: true
74+
generateReleaseNotes: true
75+
tag: "v${{ env.version }}"
76+
5577
- name: Upload Files To Oss
5678
uses: xcube-studio/sync2oss@v2
5779
with:
5880
repoUrl: "Xcube-Studio/FluentLauncher.Preview.Installer"
5981
accessKeyId: ${{ secrets.ALIYUN_ACCESSKEYID }}
60-
accessKeySecret: ${{secrets.ALIYUN_ACCESSKEYSECRET}}
61-
endpoint: ${{secrets.ALIYUN_OSS_ENDPOINT}}
62-
bucketName: ${{secrets.ALIYUN_OSS_BUCKETNAME_1}}
82+
accessKeySecret: ${{ secrets.ALIYUN_ACCESSKEYSECRET }}
83+
endpoint: ${{ secrets.ALIYUN_OSS_ENDPOINT }}
84+
bucketName: ${{ secrets.ALIYUN_OSS_BUCKETNAME_1 }}
6385
region: "cn-shanghai"
6486
addSymlink: True
6587
fromRelease: True
66-
remoteDir: "FluentLauncher.Preview.Installer"
88+
remoteDir: "FluentLauncher.Preview.Installer"

0 commit comments

Comments
 (0)