Skip to content
Open
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
93 changes: 93 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# GitHub Actions Workflows

This repository includes automated GitHub Actions workflows for building and testing RustScan across multiple platforms.

## Workflows

### 1. CI Workflow (`.github/workflows/ci.yml`)
- **Trigger**: Every push to main/master branch and pull requests
- **Purpose**: Run tests, formatting checks, and clippy lints
- **Platforms**: Ubuntu, Windows, macOS
- **Actions**:
- Code formatting check (`cargo fmt`)
- Clippy linting (`cargo clippy`)
- Unit tests (`cargo test`)
- Build verification for each platform

### 2. Release Workflow (`.github/workflows/release.yml`)
- **Trigger**:
- When a tag starting with `v` is pushed (e.g., `v2.4.1`)
- Manual workflow dispatch
- **Purpose**: Build release binaries for all platforms and create GitHub Release
- **Platforms**:
- Windows x64 (MSVC)
- macOS Intel x64
- macOS Apple Silicon (ARM64)
- Linux x64 (GNU)
- Linux ARM64 (GNU)

## How to Create a Release

### Method 1: Tag-based Release (Recommended)
```bash
# Create and push a version tag
git tag v2.4.1
git push origin v2.4.1
```

### Method 2: Manual Release
1. Go to the "Actions" tab in your GitHub repository
2. Select "Build and Release" workflow
3. Click "Run workflow"
4. Enter the version number (e.g., `v2.4.1`)
5. Click "Run workflow"

## Generated Artifacts

Each release automatically generates the following packages:

| Platform | File | Description |
|----------|------|-------------|
| Windows x64 | `rustscan-x86_64-pc-windows-msvc.zip` | Windows executable with installer |
| macOS Intel | `rustscan-x86_64-apple-darwin.tar.gz` | macOS binary for Intel Macs |
| macOS ARM64 | `rustscan-aarch64-apple-darwin.tar.gz` | macOS binary for Apple Silicon |
| Linux x64 | `rustscan-x86_64-unknown-linux-gnu.tar.gz` | Linux binary for x64 systems |
| Linux ARM64 | `rustscan-aarch64-unknown-linux-gnu.tar.gz` | Linux binary for ARM64 systems |

Each package includes:
- The compiled `rustscan` binary
- `README.md` and `LICENSE` files
- `config.toml` configuration file
- `install.sh` installation script
- `SHA256SUMS` checksum file for verification

## Installation for Users

Users can install RustScan by:

1. **Download**: Go to the [Releases page](../../releases) and download the appropriate package
2. **Extract**: Unzip or untar the downloaded file
3. **Install**: Run the installation script:
```bash
# For Unix-like systems (Linux/macOS)
./install.sh

# For Windows
# Just run the install.sh script in Git Bash or WSL
```

## Caching

The workflows use cargo caching to speed up builds:
- Cargo registry cache
- Cargo git index cache
- Target build cache

This significantly reduces build times for subsequent runs.

## Security

- Uses official GitHub Actions with pinned versions
- No external dependencies or custom scripts
- All builds are performed in isolated GitHub-hosted runners
- Generated binaries are automatically checksummed for verification
97 changes: 97 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: CI

on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]

env:
CARGO_TERM_COLOR: always

jobs:
test:
name: Test
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- name: Cache cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo build
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}

- name: Check formatting
run: cargo fmt -- --check

- name: Run clippy
run: cargo clippy -- -D warnings

- name: Run tests
run: cargo test --verbose

- name: Build
run: cargo build --verbose

build-check:
name: Build Check (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Cache cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo build
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}

- name: Build for target
run: cargo build --target ${{ matrix.target }}
Loading