Skip to content

Commit 767419e

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

File tree

1 file changed

+56
-25
lines changed

1 file changed

+56
-25
lines changed

.github/workflows/release.yml

Lines changed: 56 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,81 @@ 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+
28+
$artifactsPath = "${{ env.Artifacts_Path }}"
29+
30+
cd $artifactsPath
31+
ls -r
32+
cd ..
33+
34+
# 遍历 artifacts 目录,根据目录名称为文件添加架构标识
35+
Get-ChildItem -Path $artifactsPath -Directory | ForEach-Object {
36+
$artifactDir = $_.FullName
37+
$dirName = $_.Name
38+
39+
if ($dirName -eq "CommandLineInstaller-win-x64") {
40+
$src = Join-Path $artifactDir "FluentLauncher.CommandLineInstaller.exe"
41+
$dst = Join-Path $artifactsPath "FluentLauncher.CommandLineInstaller-win-x64.exe"
42+
if (Test-Path $src) { Move-Item -Path $src -Destination $dst }
43+
} elseif ($dirName -eq "CommandLineInstaller-win-arm64") {
44+
$src = Join-Path $artifactDir "FluentLauncher.CommandLineInstaller.exe"
45+
$dst = Join-Path $artifactsPath "FluentLauncher.CommandLineInstaller-win-arm64.exe"
46+
if (Test-Path $src) { Move-Item -Path $src -Destination $dst }
47+
} elseif ($dirName -eq "UniversalInstaller-win-x64") {
48+
$src = Join-Path $artifactDir "FluentLauncher.UniversalInstaller.exe"
49+
$dst = Join-Path $artifactsPath "FluentLauncher.UniversalInstaller-win-x64.exe"
50+
if (Test-Path $src) { Move-Item -Path $src -Destination $dst }
51+
} elseif ($dirName -eq "UniversalInstaller-win-arm64") {
52+
$src = Join-Path $artifactDir "FluentLauncher.UniversalInstaller.exe"
53+
$dst = Join-Path $artifactsPath "FluentLauncher.UniversalInstaller-win-arm64.exe"
54+
if (Test-Path $src) { Move-Item -Path $src -Destination $dst }
55+
}
56+
}
57+
2758
- name: Generate Tag
2859
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
60+
$releases = (gh release list --repo Xcube-Studio/FluentLauncher.Preview.Installer --limit 100 | Measure-Object -Line).Lines
61+
62+
$major=1
63+
$minor=0
64+
$patch=0
3465
35-
$patch += $releases % 12
36-
$minor += [math]::Floor($releases / 12)
37-
$major += [math]::Floor($minor / 6)
38-
$minor %= 6
66+
$patch += $releases % 12
67+
$minor += [math]::Floor($releases / 12)
68+
$major += [math]::Floor($minor / 6)
69+
$minor %= 6
3970
40-
$version="$major.$minor.$patch"
41-
echo "Generated version: $version"
42-
echo "version=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
71+
$version="$major.$minor.$patch"
72+
echo "Generated version: $version"
73+
echo "version=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
4374
4475
env:
4576
GH_TOKEN: ${{ github.token }}
4677

4778
- name: Create Release
4879
uses: ncipollo/[email protected]
4980
with:
50-
artifacts: "${{ env.Artifacts_Path }}\\*.*"
51-
allowUpdates: true
52-
generateReleaseNotes: true
53-
tag: "v${{ env.version }}"
54-
81+
artifacts: "${{ env.Artifacts_Path }}\\*.*"
82+
allowUpdates: true
83+
generateReleaseNotes: true
84+
tag: "v${{ env.version }}"
85+
5586
- name: Upload Files To Oss
5687
uses: xcube-studio/sync2oss@v2
5788
with:
5889
repoUrl: "Xcube-Studio/FluentLauncher.Preview.Installer"
5990
accessKeyId: ${{ secrets.ALIYUN_ACCESSKEYID }}
60-
accessKeySecret: ${{secrets.ALIYUN_ACCESSKEYSECRET}}
61-
endpoint: ${{secrets.ALIYUN_OSS_ENDPOINT}}
62-
bucketName: ${{secrets.ALIYUN_OSS_BUCKETNAME_1}}
91+
accessKeySecret: ${{ secrets.ALIYUN_ACCESSKEYSECRET }}
92+
endpoint: ${{ secrets.ALIYUN_OSS_ENDPOINT }}
93+
bucketName: ${{ secrets.ALIYUN_OSS_BUCKETNAME_1 }}
6394
region: "cn-shanghai"
6495
addSymlink: True
6596
fromRelease: True
66-
remoteDir: "FluentLauncher.Preview.Installer"
97+
remoteDir: "FluentLauncher.Preview.Installer"

0 commit comments

Comments
 (0)