Some checks failed
CI / Check (push) Failing after 2s
CI / Test (push) Failing after 2s
CI / Build (Linux x86_64) (push) Has been skipped
Security Audit / Vulnerability Scan (push) Failing after 2s
Security Audit / License & Security Policy (push) Failing after 2s
Security Audit / Static Analysis (Clippy) (push) Failing after 2s
Security Audit / Secret Detection (push) Failing after 2s
Security Audit / Check Outdated Dependencies (push) Failing after 2s
Security Audit / Unsafe Code Audit (push) Failing after 2s
Security Audit / Property-Based Testing (push) Failing after 2s
Security Audit / WASM Module Security (push) Failing after 2s
CI / Benchmarks (push) Has been skipped
CI / CI Success (push) Failing after 1s
- Move .github/workflows/ to .forgejo/workflows/ (identical YAML, runner labels changed to self-hosted) - Drop macOS/Windows CI matrix legs (no macOS/Windows runners on self-hosted act_runner) - Update Cargo.toml repository URL to git.misar.io/misaradmin/synor - Remove .github/dependabot.yml (not applicable on Forgejo)
200 lines
6.5 KiB
YAML
200 lines
6.5 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUST_BACKTRACE: 1
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build-release:
|
|
name: Build Release (${{ matrix.target }})
|
|
runs-on: self-hosted
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- target: x86_64-unknown-linux-gnu
|
|
artifact-name: synor-linux-x86_64
|
|
archive-ext: tar.gz
|
|
- target: aarch64-unknown-linux-gnu
|
|
artifact-name: synor-linux-aarch64
|
|
archive-ext: tar.gz
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: ${{ matrix.target }}
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libclang-dev llvm-dev gcc-aarch64-linux-gnu
|
|
|
|
- name: Cache cargo registry
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
key: ${{ runner.os }}-${{ matrix.target }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-${{ matrix.target }}-cargo-registry-
|
|
|
|
- name: Cache cargo target
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: target
|
|
key: ${{ runner.os }}-${{ matrix.target }}-cargo-target-release-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-${{ matrix.target }}-cargo-target-release-
|
|
|
|
- name: Build release binaries
|
|
env:
|
|
TARGET: ${{ matrix.target }}
|
|
run: cargo build --release --workspace --target "$TARGET"
|
|
|
|
- name: Prepare release archive
|
|
env:
|
|
TARGET: ${{ matrix.target }}
|
|
ARTIFACT_NAME: ${{ matrix.artifact-name }}
|
|
run: |
|
|
mkdir -p release
|
|
cp "target/$TARGET/release/synord" release/ 2>/dev/null || true
|
|
cp "target/$TARGET/release/synor-cli" release/ 2>/dev/null || true
|
|
cp "target/$TARGET/release/synor-faucet" release/ 2>/dev/null || true
|
|
cp "target/$TARGET/release/synor-explorer" release/ 2>/dev/null || true
|
|
cp README.md release/ 2>/dev/null || true
|
|
cp LICENSE* release/ 2>/dev/null || true
|
|
cp CHANGELOG.md release/ 2>/dev/null || true
|
|
cd release
|
|
tar czvf "../$ARTIFACT_NAME.tar.gz" *
|
|
|
|
- name: Upload release artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.artifact-name }}
|
|
path: ${{ matrix.artifact-name }}.tar.gz
|
|
retention-days: 1
|
|
|
|
create-release:
|
|
name: Create Forgejo Release
|
|
runs-on: self-hosted
|
|
needs: build-release
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
|
|
- name: Generate changelog
|
|
id: changelog
|
|
env:
|
|
GIT_REF: ${{ github.ref }}
|
|
run: |
|
|
CURRENT_TAG="${GIT_REF#refs/tags/}"
|
|
|
|
# Validate tag format
|
|
if [[ ! "$CURRENT_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?$ ]]; then
|
|
echo "Invalid tag format: $CURRENT_TAG"
|
|
exit 1
|
|
fi
|
|
|
|
echo "current_tag=$CURRENT_TAG" >> "$GITHUB_OUTPUT"
|
|
|
|
PREVIOUS_TAG=$(git describe --tags --abbrev=0 "$CURRENT_TAG^" 2>/dev/null || echo "")
|
|
|
|
echo "## What's Changed" > CHANGELOG_BODY.md
|
|
echo "" >> CHANGELOG_BODY.md
|
|
|
|
if [ -n "$PREVIOUS_TAG" ]; then
|
|
echo "Changes since $PREVIOUS_TAG:" >> CHANGELOG_BODY.md
|
|
echo "" >> CHANGELOG_BODY.md
|
|
git log "$PREVIOUS_TAG..$CURRENT_TAG" --pretty=format:"- %s (%h)" --no-merges >> CHANGELOG_BODY.md
|
|
else
|
|
echo "Initial release" >> CHANGELOG_BODY.md
|
|
echo "" >> CHANGELOG_BODY.md
|
|
git log --pretty=format:"- %s (%h)" --no-merges -20 >> CHANGELOG_BODY.md
|
|
fi
|
|
|
|
echo "" >> CHANGELOG_BODY.md
|
|
echo "" >> CHANGELOG_BODY.md
|
|
echo "## Installation" >> CHANGELOG_BODY.md
|
|
echo "" >> CHANGELOG_BODY.md
|
|
echo "Download the appropriate archive for your platform and extract it:" >> CHANGELOG_BODY.md
|
|
echo "" >> CHANGELOG_BODY.md
|
|
echo '```bash' >> CHANGELOG_BODY.md
|
|
echo "tar xzf synor-<platform>.tar.gz" >> CHANGELOG_BODY.md
|
|
echo "./synord --help" >> CHANGELOG_BODY.md
|
|
echo '```' >> CHANGELOG_BODY.md
|
|
echo "" >> CHANGELOG_BODY.md
|
|
echo "## Checksums" >> CHANGELOG_BODY.md
|
|
echo "" >> CHANGELOG_BODY.md
|
|
echo '```' >> CHANGELOG_BODY.md
|
|
cd artifacts
|
|
find . -name "*.tar.gz" -exec sha256sum {} \; | sed 's|./[^/]*/||' >> ../CHANGELOG_BODY.md
|
|
echo '```' >> CHANGELOG_BODY.md
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
name: Synor ${{ steps.changelog.outputs.current_tag }}
|
|
body_path: CHANGELOG_BODY.md
|
|
draft: false
|
|
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }}
|
|
files: |
|
|
artifacts/**/*.tar.gz
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
publish-crates:
|
|
name: Publish to crates.io
|
|
runs-on: self-hosted
|
|
needs: create-release
|
|
if: ${{ !contains(github.ref, 'alpha') && !contains(github.ref, 'beta') && !contains(github.ref, 'rc') }}
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libclang-dev llvm-dev
|
|
|
|
- name: Publish crates
|
|
env:
|
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
run: |
|
|
if [ -z "$CARGO_REGISTRY_TOKEN" ]; then
|
|
echo "CARGO_REGISTRY_TOKEN not set, skipping crates.io publish"
|
|
exit 0
|
|
fi
|
|
echo "Publishing to crates.io..."
|
|
# Uncomment when ready to publish:
|
|
# cargo publish -p synor-types
|
|
# cargo publish -p synor-crypto
|
|
echo "Crate publishing configured but commented out - uncomment when ready"
|