Release #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| Compile: | |
| name: Compile | |
| uses: ./.github/workflows/build.yml | |
| Release: | |
| name: Release | |
| needs: Compile | |
| runs-on: windows-latest | |
| env: | |
| Artifacts_Path: .artifacts | |
| steps: | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| merge-multiple: true | |
| path: ${{ env.Artifacts_Path }} | |
| - name: Rename Architecture-Specific Files | |
| run: | | |
| $artifactsPath = "${{ env.Artifacts_Path }}" | |
| # 重命名 x64 相关文件 | |
| Get-ChildItem -Path $artifactsPath -Filter "*x64*.exe" | ForEach-Object { | |
| $newName = $_.FullName -replace "x64", "win-x64" | |
| Rename-Item -Path $_.FullName -NewName $newName | |
| } | |
| # 重命名 arm64 相关文件 | |
| Get-ChildItem -Path $artifactsPath -Filter "*arm64*.exe" | ForEach-Object { | |
| $newName = $_.FullName -replace "arm64", "win-arm64" | |
| Rename-Item -Path $_.FullName -NewName $newName | |
| } | |
| - name: Generate Tag | |
| run: | | |
| $releases = (gh release list --repo Xcube-Studio/FluentLauncher.Preview.Installer --limit 100 | Measure-Object -Line).Lines | |
| $major=1 | |
| $minor=0 | |
| $patch=0 | |
| $patch += $releases % 12 | |
| $minor += [math]::Floor($releases / 12) | |
| $major += [math]::Floor($minor / 6) | |
| $minor %= 6 | |
| $version="$major.$minor.$patch" | |
| echo "Generated version: $version" | |
| echo "version=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - name: Create Release | |
| uses: ncipollo/[email protected] | |
| with: | |
| artifacts: "${{ env.Artifacts_Path }}\\*.*" | |
| allowUpdates: true | |
| generateReleaseNotes: true | |
| tag: "v${{ env.version }}" | |
| - name: Upload Files To Oss | |
| uses: xcube-studio/sync2oss@v2 | |
| with: | |
| repoUrl: "Xcube-Studio/FluentLauncher.Preview.Installer" | |
| accessKeyId: ${{ secrets.ALIYUN_ACCESSKEYID }} | |
| accessKeySecret: ${{ secrets.ALIYUN_ACCESSKEYSECRET }} | |
| endpoint: ${{ secrets.ALIYUN_OSS_ENDPOINT }} | |
| bucketName: ${{ secrets.ALIYUN_OSS_BUCKETNAME_1 }} | |
| region: "cn-shanghai" | |
| addSymlink: True | |
| fromRelease: True | |
| remoteDir: "FluentLauncher.Preview.Installer" |