mirror of
https://github.com/cmderdev/cmder.git
synced 2025-12-16 18:51:37 +08:00
Improve build workflow summary: add links, vendor packages, full hashes, and merge artifact sections
Co-authored-by: DRSDavidSoft <4673812+DRSDavidSoft@users.noreply.github.com>
This commit is contained in:
93
.github/workflows/build.yml
vendored
93
.github/workflows/build.yml
vendored
@@ -45,21 +45,38 @@ jobs:
|
|||||||
# Get Cmder version
|
# Get Cmder version
|
||||||
. scripts/utils.ps1
|
. scripts/utils.ps1
|
||||||
$cmderVersion = Get-VersionStr
|
$cmderVersion = Get-VersionStr
|
||||||
|
$buildTime = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
|
||||||
|
|
||||||
@"
|
@"
|
||||||
## 📦 Build Cmder - Workflow Summary
|
## 📦 Build Cmder - Workflow Summary
|
||||||
|
|
||||||
|
<small>Build started: $buildTime</small>
|
||||||
|
|
||||||
### Repository Information
|
### Repository Information
|
||||||
| Property | Value |
|
| Property | Value |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| Repository | ``${{ github.repository }}`` |
|
| Repository | [${{ github.repository }}](https://github.com/${{ github.repository }}) |
|
||||||
| Branch | ``${{ github.ref_name }}`` |
|
| Branch | [${{ github.ref_name }}](https://github.com/${{ github.repository }}/tree/${{ github.ref_name }}) |
|
||||||
| Commit | ``${{ github.sha }}`` |
|
| Commit | [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }}) |
|
||||||
| Actor | @${{ github.actor }} |
|
| Actor | [@${{ github.actor }}](https://github.com/${{ github.actor }}) |
|
||||||
| Workflow | ``${{ github.workflow }}`` |
|
| Workflow | ``${{ github.workflow }}`` |
|
||||||
| Cmder Version | **$cmderVersion** |
|
| Cmder Version | **$cmderVersion** |
|
||||||
|
|
||||||
"@ | Add-Content -Path $env:GITHUB_STEP_SUMMARY -Encoding utf8
|
---
|
||||||
|
|
||||||
|
### Vendor Packages
|
||||||
|
| Package | Version |
|
||||||
|
| --- | --- |
|
||||||
|
"@
|
||||||
|
|
||||||
|
# Read vendor sources.json and add to summary
|
||||||
|
$vendorSources = Get-Content "vendor/sources.json" | ConvertFrom-Json
|
||||||
|
foreach ($vendor in $vendorSources) {
|
||||||
|
$summary += "`n| ``$($vendor.name)`` | $($vendor.version) |"
|
||||||
|
}
|
||||||
|
$summary += "`n"
|
||||||
|
|
||||||
|
$summary | Add-Content -Path $env:GITHUB_STEP_SUMMARY -Encoding utf8
|
||||||
|
|
||||||
- name: Add MSBuild to PATH
|
- name: Add MSBuild to PATH
|
||||||
uses: microsoft/setup-msbuild@v2
|
uses: microsoft/setup-msbuild@v2
|
||||||
@@ -74,9 +91,12 @@ jobs:
|
|||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
@"
|
@"
|
||||||
### ✅ Build Status
|
|
||||||
|
|
||||||
Cmder launcher successfully compiled.
|
---
|
||||||
|
|
||||||
|
### Build Status
|
||||||
|
|
||||||
|
✅ Cmder launcher successfully compiled.
|
||||||
|
|
||||||
"@ | Add-Content -Path $env:GITHUB_STEP_SUMMARY -Encoding utf8
|
"@ | Add-Content -Path $env:GITHUB_STEP_SUMMARY -Encoding utf8
|
||||||
|
|
||||||
@@ -85,31 +105,6 @@ jobs:
|
|||||||
working-directory: scripts
|
working-directory: scripts
|
||||||
run: .\pack.ps1 -verbose
|
run: .\pack.ps1 -verbose
|
||||||
|
|
||||||
- name: Summary - Package artifacts
|
|
||||||
if: success()
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
$summary = @"
|
|
||||||
### 📦 Artifacts Created
|
|
||||||
|
|
||||||
| Artifact | Size | Hash (SHA256) |
|
|
||||||
| --- | --- | --- |
|
|
||||||
"@
|
|
||||||
|
|
||||||
$artifacts = @("cmder.zip", "cmder.7z", "cmder_mini.zip")
|
|
||||||
foreach ($artifact in $artifacts) {
|
|
||||||
$path = "build/$artifact"
|
|
||||||
if (Test-Path $path) {
|
|
||||||
$size = (Get-Item $path).Length / 1MB
|
|
||||||
# Truncate hash to first 16 chars for summary readability (full hash in hashes.txt)
|
|
||||||
$hash = (Get-FileHash $path -Algorithm SHA256).Hash.Substring(0, 16)
|
|
||||||
$summary += "`n| ``$artifact`` | $([math]::Round($size, 2)) MB | ``$hash...`` |"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$summary += "`n"
|
|
||||||
|
|
||||||
$summary | Add-Content -Path $env:GITHUB_STEP_SUMMARY -Encoding utf8
|
|
||||||
|
|
||||||
- name: Upload artifact (cmder.zip)
|
- name: Upload artifact (cmder.zip)
|
||||||
uses: actions/upload-artifact@v5
|
uses: actions/upload-artifact@v5
|
||||||
with:
|
with:
|
||||||
@@ -140,15 +135,28 @@ jobs:
|
|||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
@"
|
@"
|
||||||
### ☁️ Upload Status
|
|
||||||
|
|
||||||
All artifacts successfully uploaded to GitHub Actions:
|
---
|
||||||
- ✅ ``cmder.zip``
|
|
||||||
- ✅ ``cmder.7z``
|
|
||||||
- ✅ ``cmder_mini.zip``
|
|
||||||
- ✅ ``hashes.txt``
|
|
||||||
|
|
||||||
"@ | Add-Content -Path $env:GITHUB_STEP_SUMMARY -Encoding utf8
|
### Artifacts
|
||||||
|
|
||||||
|
| Artifact | Size | Hash (SHA256) | Download |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
"@
|
||||||
|
|
||||||
|
$artifacts = @("cmder.zip", "cmder.7z", "cmder_mini.zip", "hashes.txt")
|
||||||
|
foreach ($artifact in $artifacts) {
|
||||||
|
$path = "build/$artifact"
|
||||||
|
if (Test-Path $path) {
|
||||||
|
$size = (Get-Item $path).Length / 1MB
|
||||||
|
$hash = (Get-FileHash $path -Algorithm SHA256).Hash
|
||||||
|
$downloadUrl = "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
||||||
|
$summary += "`n| ``$artifact`` | $([math]::Round($size, 2)) MB | ``$hash`` | [Download]($downloadUrl) |"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$summary += "`n"
|
||||||
|
|
||||||
|
$summary | Add-Content -Path $env:GITHUB_STEP_SUMMARY -Encoding utf8
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
@@ -167,9 +175,12 @@ jobs:
|
|||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
@"
|
@"
|
||||||
### 🚀 Release Information
|
|
||||||
|
|
||||||
Draft release created for tag: **``${{ github.ref_name }}``**
|
---
|
||||||
|
|
||||||
|
### Release Information
|
||||||
|
|
||||||
|
🚀 Draft release created for tag: **``${{ github.ref_name }}``**
|
||||||
|
|
||||||
Release includes:
|
Release includes:
|
||||||
- Full version (``cmder.zip``, ``cmder.7z``)
|
- Full version (``cmder.zip``, ``cmder.7z``)
|
||||||
|
|||||||
Reference in New Issue
Block a user