|
| 1 | +# GitHub Actions Workflows |
| 2 | + |
| 3 | +This directory contains GitHub Actions workflow definitions for automating the build, test, and release processes for the OpenSVM-Dioxus project. |
| 4 | + |
| 5 | +## CI/CD Pipeline (`ci.yml`) |
| 6 | + |
| 7 | +This workflow handles the continuous integration and continuous deployment process for the OpenSVM-Dioxus project. |
| 8 | + |
| 9 | +### Triggers |
| 10 | + |
| 11 | +- **Push** to the `main` branch |
| 12 | +- **Push** of tags matching the pattern `v*` (e.g., `v1.0.0`) |
| 13 | +- **Pull requests** targeting the `main` branch |
| 14 | + |
| 15 | +### Jobs |
| 16 | + |
| 17 | +#### 1. Build & Test |
| 18 | + |
| 19 | +This job builds and tests the application across multiple platforms: |
| 20 | + |
| 21 | +- **Web (WASM)** - Built on Ubuntu |
| 22 | +- **Desktop (macOS)** - Built on macOS |
| 23 | +- **Desktop (Windows)** - Built on Windows |
| 24 | +- **Android** - Built on Ubuntu |
| 25 | + |
| 26 | +Each platform build includes platform-specific optimizations: |
| 27 | + |
| 28 | +- **Web**: WASM optimization with `wasm-opt` |
| 29 | +- **Desktop**: Native CPU instructions with `-C target-cpu=native` |
| 30 | +- **Android**: APK optimization with `zipalign` and `apksigner` |
| 31 | + |
| 32 | +#### 2. Release |
| 33 | + |
| 34 | +This job is triggered only when a tag matching the pattern `v*` is pushed. It: |
| 35 | + |
| 36 | +- Downloads all build artifacts |
| 37 | +- Packages them into platform-specific ZIP files |
| 38 | +- Creates a GitHub release with the packaged artifacts |
| 39 | +- Generates release notes automatically |
| 40 | + |
| 41 | +#### 3. Homebrew Formula Update |
| 42 | + |
| 43 | +This job is triggered only when a tag matching the pattern `v*` is pushed. It: |
| 44 | + |
| 45 | +- Creates or updates a Homebrew formula for the macOS release |
| 46 | +- Calculates the SHA256 hash of the macOS release artifact |
| 47 | +- Creates a pull request to update the formula |
| 48 | + |
| 49 | +#### 4. Android Build |
| 50 | + |
| 51 | +This job builds the Android APK and: |
| 52 | + |
| 53 | +- Optimizes the APK with `zipalign` |
| 54 | +- Signs the APK with a debug key |
| 55 | +- Uploads the APK as an artifact |
| 56 | +- Adds the APK to the GitHub release (if triggered by a tag) |
| 57 | + |
| 58 | +## GitHub Actions Used |
| 59 | + |
| 60 | +This workflow uses the following GitHub Actions: |
| 61 | + |
| 62 | +- `actions/checkout@v4`: Checks out the repository |
| 63 | +- `actions/setup-java@v4`: Sets up JDK for Android builds |
| 64 | +- `actions/cache@v4`: Caches Cargo dependencies for faster builds |
| 65 | +- `actions/upload-artifact@v4`: Uploads build artifacts |
| 66 | +- `actions/download-artifact@v4`: Downloads artifacts for releases |
| 67 | +- `actions-rs/toolchain@v1`: Sets up Rust toolchain |
| 68 | +- `actions-rs/cargo@v1`: Runs Cargo commands |
| 69 | +- `softprops/action-gh-release@v1`: Creates GitHub releases |
| 70 | +- `android-actions/setup-android@v2`: Sets up Android SDK |
| 71 | + |
| 72 | +## Usage |
| 73 | + |
| 74 | +### Regular Development |
| 75 | + |
| 76 | +The CI pipeline will automatically run on all pull requests to validate changes. |
| 77 | + |
| 78 | +### Creating a Release |
| 79 | + |
| 80 | +To create a new release: |
| 81 | + |
| 82 | +1. Create and push a new tag following semantic versioning: |
| 83 | + ```bash |
| 84 | + git tag v1.0.0 |
| 85 | + git push origin v1.0.0 |
| 86 | + ``` |
| 87 | + |
| 88 | +2. The workflow will automatically: |
| 89 | + - Build all platform versions |
| 90 | + - Create a GitHub release with all artifacts |
| 91 | + - Update the Homebrew formula |
| 92 | + |
| 93 | +### Customizing the Workflow |
| 94 | + |
| 95 | +To modify the workflow: |
| 96 | + |
| 97 | +1. Edit the `.github/workflows/ci.yml` file |
| 98 | +2. Commit and push your changes |
| 99 | +3. The updated workflow will be used for subsequent runs |
0 commit comments