Skip to content

legal note

legal note #24

Workflow file for this run

name: CI
on:
push:
branches: [main]
tags: ['v[0-9]+.[0-9]+.[0-9]+*']
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
lint:
name: Lint
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-ios
components: rustfmt, clippy
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Check formatting
run: cargo fmt --all -- --check
- name: Clippy (host target — logic only)
run: cargo clippy --lib -- -D warnings
build:
name: Build & Verify
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-ios
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Type-check (aarch64-apple-ios)
run: cargo check --target aarch64-apple-ios
- name: Build libspecter.a
run: make
- name: Verify exported symbols
run: make check
- name: Upload library artifact
uses: actions/upload-artifact@v4
with:
name: libspecter-${{ github.sha }}
path: |
target/aarch64-apple-ios/release/libspecter.a
specter.h
retention-days: 7
publish-package:
name: Publish GitHub Package
needs: [lint, build]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: macos-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-ios
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Build libspecter.a
run: make
- name: Install ORAS
uses: oras-project/setup-oras@v1
- name: Push artifacts to GitHub Container Registry
run: |
echo "${{ github.token }}" | oras login ghcr.io \
--username "${{ github.actor }}" --password-stdin
REPO_LC=$(echo "$GITHUB_REPOSITORY" | tr '[:upper:]' '[:lower:]')
oras push "ghcr.io/${REPO_LC}:${{ github.ref_name }}" \
--artifact-type "application/vnd.specter.library.v1" \
target/aarch64-apple-ios/release/libspecter.a:application/octet-stream \
specter.h:text/plain
if [[ "${{ github.ref_name }}" != *-* ]]; then
oras tag "ghcr.io/${REPO_LC}:${{ github.ref_name }}" latest
fi
release:
name: Publish Release
needs: [lint, build]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: macos-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-ios
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Build libspecter.a (release)
run: make
- name: Verify exported symbols
run: make check
- name: Package release artifacts
run: |
ARCHIVE="specter-${{ github.ref_name }}-aarch64-apple-ios.tar.gz"
tar -czf "$ARCHIVE" \
target/aarch64-apple-ios/release/libspecter.a \
specter.h
echo "ARCHIVE=$ARCHIVE" >> "$GITHUB_ENV"
shasum -a 256 "$ARCHIVE" > "$ARCHIVE.sha256"
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
PRERELEASE=""
if [[ "${{ github.ref_name }}" == *-* ]]; then
PRERELEASE="--prerelease"
fi
gh release create "${{ github.ref_name }}" \
--title "Specter ${{ github.ref_name }}" \
--generate-notes \
$PRERELEASE \
"${{ env.ARCHIVE }}" \
"${{ env.ARCHIVE }}.sha256"