Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
27063d48
Commit
27063d48
authored
Feb 10, 2026
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(ci): auto-upload binaries to GitHub Release on publish
parent
71e8a064
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
59 deletions
+29
-59
build-binaries.yml
.github/workflows/build-binaries.yml
+29
-59
No files found.
.github/workflows/build-binaries.yml
View file @
27063d48
name
:
Build Binaries
name
:
Build Binaries
#
Manually triggered workflow to build multi-platform binaries
#
Build multi-platform binaries on release or manual trigger
# Produces distributable packages for Linux, macOS, and Windows
# Produces distributable packages for Linux, macOS, and Windows
on
:
on
:
release
:
types
:
[
published
]
workflow_dispatch
:
workflow_dispatch
:
# Environment variables for build configuration
# Environment variables for build configuration
...
@@ -11,6 +13,8 @@ env:
...
@@ -11,6 +13,8 @@ env:
NODE_VERSION
:
"
22"
NODE_VERSION
:
"
22"
PNPM_VERSION
:
"
10"
PNPM_VERSION
:
"
10"
ARTIFACT_RETENTION_DAYS
:
60
ARTIFACT_RETENTION_DAYS
:
60
# Artifact naming: {ARTIFACT_PREFIX}_{version}_{os}_{arch}.tar.gz|zip
ARTIFACT_PREFIX
:
memos
jobs
:
jobs
:
# Job 1: Extract version information
# Job 1: Extract version information
...
@@ -176,8 +180,8 @@ jobs:
...
@@ -176,8 +180,8 @@ jobs:
run
:
|
run
:
|
cd build
cd build
# Construct package name:
memos-{version}-{os}-
{arch}[v{arm_version}]
# Construct package name:
{prefix}_{version}_{os}_
{arch}[v{arm_version}]
PACKAGE_NAME="
memos-${VERSION}-${GOOS}-
${GOARCH}"
PACKAGE_NAME="
${ARTIFACT_PREFIX}_${VERSION}_${GOOS}_
${GOARCH}"
if [ -n "$GOARM" ]; then
if [ -n "$GOARM" ]; then
PACKAGE_NAME="${PACKAGE_NAME}v${GOARM}"
PACKAGE_NAME="${PACKAGE_NAME}v${GOARM}"
fi
fi
...
@@ -202,60 +206,26 @@ jobs:
...
@@ -202,60 +206,26 @@ jobs:
path
:
build/${{ env.ARTIFACT_NAME }}
path
:
build/${{ env.ARTIFACT_NAME }}
retention-days
:
${{ env.ARTIFACT_RETENTION_DAYS }}
retention-days
:
${{ env.ARTIFACT_RETENTION_DAYS }}
# Job 4:
Generate build summary
# Job 4:
Upload artifacts to GitHub Release
# -
Downloads all built artifacts
# -
Only runs when triggered by a release publish event
# -
Creates formatted summary table with sizes
# -
Downloads all built artifacts and attaches them to the release
# - Displayed in GitHub Actions UI
release
:
summary
:
name
:
Upload Release Assets
n
ame
:
Generate Summary
n
eeds
:
build-binaries
needs
:
[
prepare
,
build-binaries
]
if
:
github.event_name == 'release'
runs-on
:
ubuntu-latest
runs-on
:
ubuntu-latest
if
:
always()
permissions
:
contents
:
write
steps
:
steps
:
-
name
:
Download all artifacts
-
name
:
Download all artifacts
uses
:
actions/download-artifact@v7
uses
:
actions/download-artifact@v7
with
:
with
:
path
:
artifacts
path
:
artifacts
pattern
:
memos-
*
pattern
:
${{ env.ARTIFACT_PREFIX }}_
*
merge-multiple
:
fals
e
merge-multiple
:
tru
e
-
name
:
Generate build summary
-
name
:
Upload to GitHub Release
env
:
uses
:
softprops/action-gh-release@v2
VERSION
:
${{ needs.prepare.outputs.version }}
with
:
run
:
|
files
:
artifacts/*
{
echo "## 🎉 Build Complete"
echo ""
echo "### Build Information"
echo "| Key | Value |"
echo "|-----|-------|"
echo "| **Version** | \`${VERSION}\` |"
echo "| **Branch** | \`${{ github.ref_name }}\` |"
echo "| **Commit** | \`${{ github.sha }}\` |"
echo "| **Triggered by** | @${{ github.actor }} |"
echo ""
echo "### 📦 Built Artifacts"
echo ""
echo "| Platform | Artifact | Size |"
echo "|----------|----------|------|"
} >> $GITHUB_STEP_SUMMARY
# List all artifacts with sizes
cd artifacts
for dir in */; do
if [ -d "$dir" ]; then
artifact=$(ls "$dir" 2>/dev/null | head -1)
if [ -n "$artifact" ]; then
size=$(du -h "$dir/$artifact" | cut -f1)
# Extract platform from filename (remove memos-version- prefix and extension)
platform=$(echo "$artifact" | sed "s/memos-${VERSION}-//;s/\.(tar\.gz|zip)$//")
echo "| \`$platform\` | \`$artifact\` | **$size** |" >> $GITHUB_STEP_SUMMARY
fi
fi
done
{
echo ""
echo "### 📥 Download"
echo "Artifacts are available in the **Artifacts** section above (retention: ${{ env.ARTIFACT_RETENTION_DAYS }} days)."
} >> $GITHUB_STEP_SUMMARY
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment