Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 27 additions & 12 deletions .github/workflows/release_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,48 @@ on:
jobs:
build-linux:
name: Build and Release Linux Binary
runs-on: ubuntu-latest
runs-on: ubuntu-latest # The job will run on an Ubuntu runner

steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4 # Use actions/checkout@v4 as per your example
uses: actions/checkout@v4 # Correct use of 'uses' within steps

# Set up Rust toolchain
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@stable # Set up Rust toolchain to use stable version

- name: Install dependencies
uses: dtolnay/rust-toolchain@stable # Set up the Rust toolchain

# Install Linux dependencies (for alsa-sys and other potential native dependencies)
- name: Install Linux ALSA dependencies
run: |
cargo build --release
sudo apt-get update
sudo apt-get install -y libasound2-dev # Install ALSA development libraries
sudo apt-get install -y pkg-config # Ensure pkg-config is installed

# Build for Linux (this is where the actual build for the target is done)
- name: Build for Linux
run: |
cargo build --release --target x86_64-unknown-linux-gnu

# Create the binaries directory if it doesn't exist
- name: Create release binaries directory
run: |
mkdir -p target/release/binaries # Create the binaries directory if it doesn't exist

mkdir -p target/release/binaries

# Copy the built binary into the binaries directory
- name: Copy Linux binary
run: |
cp target/x86_64-unknown-linux-gnu/release/shell_command_menu target/release/binaries/ # Copy the binary
cp target/x86_64-unknown-linux-gnu/release/shell_command_menu target/release/binaries/


- name: Zip and rename the binary
run: |
cd target/release/binaries
tar -czf shell_command_menu_linux.tgz shell_command_menu # Create a .tgz archive of the binary

# Upload the binaries to the GitHub release
- name: Upload binaries to GitHub release
uses: softprops/action-gh-release@v2.2.2
uses: softprops/action-gh-release@v2.2.2 # Use the updated version of gh-release
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: target/release/binaries/* # Upload all files from the binaries folder
token: ${{ secrets.GH_PAT_CLI_MENU }} # GitHub token for authentication
files: target/release/binaries/shell_command_menu_linux.tgz # Upload the .tgz file
73 changes: 73 additions & 0 deletions .github/workflows/release_mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Release Binaries (macOS)

on:
push:
tags:
- 'v*' # Trigger on tags starting with "v" (e.g., v1.0.0)

jobs:
build-macos:
name: Build and Release macOS Binaries
runs-on: macos-latest # The job will run on a macOS runner

steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4 # Correct use of 'uses' within steps

# Set up Rust toolchain
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@stable # Set up the Rust toolchain

# Install macOS targets using rustup
- name: Add macOS targets
run: |
rustup target add x86_64-apple-darwin # Add macOS Intel target
rustup target add aarch64-apple-darwin # Add macOS ARM target


# Build for macOS Intel (x86_64)
- name: Build for macOS Intel
run: |
cargo build --release --target x86_64-apple-darwin

# Build for macOS ARM (aarch64)
- name: Build for macOS ARM
run: |
cargo build --release --target aarch64-apple-darwin

# Create the binaries directory if it doesn't exist
- name: Create release binaries directory
run: |
mkdir -p target/release/binaries

# Copy the macOS Intel binary into the binaries directory
- name: Copy macOS Intel binary
run: |
cp target/x86_64-apple-darwin/release/shell_command_menu target/release/binaries/shell_command_menu_intel

# Copy the macOS ARM binary into the binaries directory
- name: Copy macOS ARM binary
run: |
cp target/aarch64-apple-darwin/release/shell_command_menu target/release/binaries/shell_command_menu_arm

# Zip and rename the Intel binary
- name: Zip and rename the macOS Intel binary
run: |
cd target/release/binaries
tar -czf shell_command_menu_macos_intel.tgz shell_command_menu_intel # Create a .tgz archive for Intel

# Zip and rename the ARM binary
- name: Zip and rename the macOS ARM binary
run: |
cd target/release/binaries
tar -czf shell_command_menu_macos_arm.tgz shell_command_menu_arm # Create a .tgz archive for ARM

# Upload the binaries to the GitHub release
- name: Upload binaries to GitHub release
uses: softprops/action-gh-release@v2.2.2 # Use the updated version of gh-release
with:
token: ${{ secrets.GH_PAT_CLI_MENU }} # GitHub token for authentication
files: |
target/release/binaries/shell_command_menu_macos_intel.tgz # Upload the Intel .tgz file
target/release/binaries/shell_command_menu_macos_arm.tgz # Upload the ARM .tgz file
2 changes: 1 addition & 1 deletion src/changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Changelog

05/26/25
Test Autobuild for Linux - 1
Test Autobuild for Linux and for Mac.

05/11/25
Updated Cargo.tml and dependencies for Rust/Cargo 2024 Edition
Expand Down
Loading