feat(ci): pipelines Gitea Actions CI + release multi-arch
- ci.yaml : cargo check + clippy (-D warnings) + fmt + tests sur push/PR main - release.yaml : build cross (amd64/arm64/armv7) via cross-rs, création release Gitea avec binaires nommés par architecture sur tag v* - ROADMAP Phase 5 marquée complète Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,110 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build ${{ matrix.target }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- target: x86_64-unknown-linux-gnu
|
||||
arch_label: amd64
|
||||
- target: aarch64-unknown-linux-gnu
|
||||
arch_label: arm64
|
||||
- target: armv7-unknown-linux-gnueabihf
|
||||
arch_label: armv7
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Installation Rust + cible cross
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
|
||||
- name: Installation cross
|
||||
run: cargo install cross --git https://github.com/cross-rs/cross
|
||||
|
||||
- name: Cache Cargo
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml') }}
|
||||
|
||||
- name: Build backend
|
||||
run: cross build --release --target ${{ matrix.target }} -p sentinelmesh-backend
|
||||
|
||||
- name: Build agent-scan-network
|
||||
run: cross build --release --target ${{ matrix.target }} -p agent-scan-network
|
||||
|
||||
- name: Build agent-metric
|
||||
run: cross build --release --target ${{ matrix.target }} -p agent-metric
|
||||
|
||||
- name: Renommage des binaires
|
||||
run: |
|
||||
mkdir -p dist
|
||||
cp target/${{ matrix.target }}/release/sentinelmesh-backend dist/sentinelmesh-backend-${{ matrix.arch_label }}
|
||||
cp target/${{ matrix.target }}/release/agent-scan-network dist/agent-scan-network-${{ matrix.arch_label }}
|
||||
cp target/${{ matrix.target }}/release/agent-metric dist/agent-metric-${{ matrix.arch_label }}
|
||||
|
||||
- name: Upload artefacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: binaries-${{ matrix.arch_label }}
|
||||
path: dist/
|
||||
|
||||
release:
|
||||
name: Création de la release Gitea
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Téléchargement des artefacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
path: dist/
|
||||
|
||||
- name: Mise à plat des binaires
|
||||
run: |
|
||||
mkdir -p release
|
||||
find dist/ -type f -exec cp {} release/ \;
|
||||
ls -la release/
|
||||
|
||||
- name: Création de la release
|
||||
uses: actions/gitea-release@v1
|
||||
with:
|
||||
token: ${{ secrets.GITEA_TOKEN }}
|
||||
tag_name: ${{ github.ref_name }}
|
||||
release_name: "SentinelMesh ${{ github.ref_name }}"
|
||||
body: |
|
||||
## SentinelMesh ${{ github.ref_name }}
|
||||
|
||||
### Binaires disponibles
|
||||
|
||||
| Composant | amd64 | arm64 | armv7 (Raspberry Pi) |
|
||||
|-----------|-------|-------|----------------------|
|
||||
| Backend | ✅ | ✅ | ✅ |
|
||||
| agent-scan-network | ✅ | ✅ | ✅ |
|
||||
| agent-metric | ✅ | ✅ | ✅ |
|
||||
|
||||
### Installation rapide
|
||||
|
||||
```bash
|
||||
curl -fsSL http://<backend>:8080/install.sh | sudo bash -s -- \
|
||||
--server http://<backend>:8080 \
|
||||
--token <token> \
|
||||
--agent-type scan-network
|
||||
```
|
||||
files: release/*
|
||||
draft: false
|
||||
prerelease: false
|
||||
Reference in New Issue
Block a user