WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
This repository was archived by the owner on Oct 28, 2025. It is now read-only.

Release

Release #4

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version (e.g.: v1, v2)'
required: true
type: string
permissions:
contents: write
jobs:
build:
strategy:
matrix:
include:
- os: macos-latest
target: macos
build_command: just build-macos
binary_path: app-rust/target/release/heartio-rust
artifact_name: heartio_${{ github.event.inputs.version }}_macos
- os: ubuntu-latest
target: windows
build_command: just build-windows
binary_path: app-rust/target/x86_64-pc-windows-gnu/release/heartio-rust.exe
artifact_name: heartio_${{ github.event.inputs.version }}.exe
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup just
uses: extractions/setup-just@v1
- name: Install cross-compilation tools (Windows)
if: matrix.target == 'windows'
run: |
sudo apt-get update
sudo apt-get install -y gcc-mingw-w64
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Add Windows target (Windows)
if: matrix.target == 'windows'
run: rustup target add x86_64-pc-windows-gnu
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: app-rust
key: ${{ matrix.target }}
cache-on-failure: true
- name: Build binary
run: |
${{ matrix.build_command }}
- name: Optimize binary (macOS)
if: matrix.target == 'macos'
run: |
cd app-rust
# Additional strip for extra size reduction (already configured in Cargo.toml)
strip target/release/heartio-rust || true
# Display file size and info
echo "=== macOS Binary Info ==="
ls -lh target/release/heartio-rust
file target/release/heartio-rust
du -h target/release/heartio-rust
- name: Optimize binary (Windows)
if: matrix.target == 'windows'
run: |
cd app-rust
# Additional strip for Windows binary (if available)
x86_64-w64-mingw32-strip target/x86_64-pc-windows-gnu/release/heartio-rust.exe || true
# Display file size and info
echo "=== Windows Binary Info ==="
ls -lh target/x86_64-pc-windows-gnu/release/heartio-rust.exe
file target/x86_64-pc-windows-gnu/release/heartio-rust.exe || true
du -h target/x86_64-pc-windows-gnu/release/heartio-rust.exe
- name: Compress binary with UPX (optional)
if: matrix.target == 'windows'
run: |
echo "DO NOT USE UPX ON WINDOWS BINARY"
- name: Prepare artifact
shell: bash
run: |
if [ "${{ matrix.target }}" = "windows" ]; then
cp ${{ matrix.binary_path }} heartio_${{ github.event.inputs.version }}.exe
else
cp ${{ matrix.binary_path }} heartio_${{ github.event.inputs.version }}_macos
fi
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}-binary
path: heartio_${{ github.event.inputs.version }}*
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.version }}
name: ${{ github.event.inputs.version }}
files: |
./artifacts/macos-binary/heartio_${{ github.event.inputs.version }}_macos
./artifacts/windows-binary/heartio_${{ github.event.inputs.version }}.exe
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}