|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +jobs: |
| 7 | + |
| 8 | + Compile: |
| 9 | + name: Compile |
| 10 | + uses: ./.github/workflows/build.yml |
| 11 | + |
| 12 | + Release: |
| 13 | + name: Release |
| 14 | + needs: Compile |
| 15 | + runs-on: windows-latest |
| 16 | + env: |
| 17 | + Artifacts_Path: .artifacts |
| 18 | + |
| 19 | + steps: |
| 20 | + |
| 21 | + - name: Download Artifacts |
| 22 | + uses: actions/download-artifact@v4 |
| 23 | + with: |
| 24 | + merge-multiple: true |
| 25 | + path: ${{ env.Artifacts_Path }} |
| 26 | + |
| 27 | + - name: Generate Tag |
| 28 | + 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 |
| 34 | +
|
| 35 | + $patch += $releases % 12 |
| 36 | + $minor += [math]::Floor($releases / 12) |
| 37 | + $major += [math]::Floor($minor / 6) |
| 38 | + $minor %= 6 |
| 39 | +
|
| 40 | + $version="$major.$minor.$patch" |
| 41 | + echo "Generated version: $version" |
| 42 | + echo "version=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append |
| 43 | +
|
| 44 | + env: |
| 45 | + GH_TOKEN: ${{ github.token }} |
| 46 | + |
| 47 | + - name: Create Release |
| 48 | + |
| 49 | + with: |
| 50 | + artifacts: "${{ env.Artifacts_Path }}\\*.*" |
| 51 | + allowUpdates: true |
| 52 | + generateReleaseNotes: true |
| 53 | + tag: "v${{ env.version }}" |
| 54 | + |
| 55 | + - name: Upload Files To Oss |
| 56 | + uses: xcube-studio/sync2oss@v2 |
| 57 | + with: |
| 58 | + repoUrl: "Xcube-Studio/FluentLauncher.Preview.Installer" |
| 59 | + accessKeyId: ${{ secrets.ALIYUN_ACCESSKEYID }} |
| 60 | + accessKeySecret: ${{secrets.ALIYUN_ACCESSKEYSECRET}} |
| 61 | + endpoint: ${{secrets.ALIYUN_OSS_ENDPOINT}} |
| 62 | + bucketName: ${{secrets.ALIYUN_OSS_BUCKETNAME_1}} |
| 63 | + region: "cn-shanghai" |
| 64 | + addSymlink: True |
| 65 | + fromRelease: True |
| 66 | + remoteDir: "FluentLauncher.Preview.Installer" |
0 commit comments