1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 11:31:46 +00:00

release binaries via GH releases and update installer fallback

This commit is contained in:
Tw93
2025-12-29 20:23:11 +08:00
parent a95355c002
commit af61748977
10 changed files with 274 additions and 73 deletions

View File

@@ -9,73 +9,39 @@ permissions:
contents: write
jobs:
build-release:
release:
name: Build & Release
runs-on: macos-latest
steps:
- name: Checkout source code
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v5
with:
go-version: "1.24.6"
cache: true
- name: Build Universal Binary for disk analyzer
run: ./scripts/build-analyze.sh
- name: Build Universal Binary for system status
run: ./scripts/build-status.sh
- name: Verify binary is valid
- name: Build Binaries
run: |
if [[ ! -x bin/analyze-go ]]; then
echo "Error: bin/analyze-go is not executable"
exit 1
fi
if [[ ! -x bin/status-go ]]; then
echo "Error: bin/status-go is not executable"
exit 1
fi
echo "Binary info:"
file bin/analyze-go
ls -lh bin/analyze-go
file bin/status-go
ls -lh bin/status-go
echo ""
echo "✓ Universal binary built successfully"
make release
ls -l bin/
- name: Commit binaries for release
run: |
# Configure Git
git config user.name "Tw93"
git config user.email "tw93@qq.com"
# Save binaries to temp location
cp bin/analyze-go /tmp/analyze-go
cp bin/status-go /tmp/status-go
# Switch to main branch
git fetch origin main
git checkout main
git pull origin main
# Restore binaries
mv /tmp/analyze-go bin/analyze-go
mv /tmp/status-go bin/status-go
# Commit and Push
git add bin/analyze-go bin/status-go
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "chore: update binaries for ${GITHUB_REF#refs/tags/}"
git push origin main
fi
- name: Create Release
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
bin/analyze-darwin-amd64
bin/analyze-darwin-arm64
bin/status-darwin-amd64
bin/status-darwin-arm64
generate_release_notes: true
draft: false
prerelease: false
update-formula:
runs-on: ubuntu-latest
needs: build-release
needs: release
steps:
- name: Extract version from tag
id: tag_version

View File

@@ -61,9 +61,17 @@ jobs:
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v5
with:
go-version: "1.24.6"
- name: Install dependencies
run: brew install coreutils
- name: Build binaries
run: make build
- name: Test module loading
run: |
echo "Testing module loading..."