Skip to content
Merged
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
74 changes: 48 additions & 26 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
name: soar nightly

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

on:
push:
tags:
- nightly
workflow_dispatch:

permissions:
attestations: write
contents: write
id-token: write

jobs:

Expand All @@ -29,18 +34,22 @@ jobs:
fail-fast: false
matrix:
build:
- {
NAME: x86_64-linux,
TARGET: x86_64-unknown-linux-musl,
}
- {
NAME: aarch64-linux,
TARGET: aarch64-unknown-linux-musl,
}
- {
NAME: loongarch64-linux,
TARGET: loongarch64-unknown-linux-musl
}
- {
NAME: riscv64-linux,
TARGET: riscv64gc-unknown-linux-musl
}
- {
NAME: x86_64-linux,
TARGET: x86_64-unknown-linux-musl,
}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -54,40 +63,45 @@ jobs:
- name: Install dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
--allow-unauthenticated musl-tools b3sum
sudo apt update -y
sudo apt install b3sum findutils file -y

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
targets: ${{ matrix.build.TARGET }}

- name: Install cross-compilation tools
uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.build.TARGET }}
- name: Install Cross
shell: bash
run: |
cargo install cross --git "https://github.com/cross-rs/cross" --jobs="$(($(nproc)+1))"
hash -r &>/dev/null
command -v cross &>/dev/null || { echo "cross command not found" >&2; exit 1; }

- name: Build
run: SOAR_NIGHTLY=1 RUSTFLAGS="-C target-feature=+crt-static" cargo build --release --locked --target ${{ matrix.build.TARGET }}
env:
RUSTFLAGS: "-C target-feature=+crt-static \
-C link-self-contained=yes \
-C link-arg=-Wl,--build-id=none"
SOAR_NIGHTLY: "1"
run: cross +nightly build --release --locked --target "${{ matrix.build.TARGET }}" --jobs="$(($(nproc)+1))" --verbose

- name: Prepare release assets
env:
ARTIFACT: "release/soar-${{ matrix.build.NAME }}"
ARCHIVE: "soar-${{ matrix.build.NAME }}.tar.gz"
shell: bash
run: |
mkdir -p release
cp {LICENSE,README.md,CHANGELOG.md} release/
cp "target/${{ matrix.build.TARGET }}/release/soar" release/

- name: Create release artifacts
shell: bash
run: |
cp release/soar soar-${{ matrix.build.NAME }}
b3sum soar-${{ matrix.build.NAME }} \
> soar-${{ matrix.build.NAME }}.b3sum
tar -czvf soar-${{ matrix.build.NAME }}.tar.gz \
release/
b3sum soar-${{ matrix.build.NAME }}.tar.gz \
> soar-${{ matrix.build.NAME }}.tar.gz.b3sum
cp {LICENSE,README.md} release/
cp "target/${{ matrix.build.TARGET }}/release/soar" "${ARTIFACT}"
b3sum "${ARTIFACT}" > "${ARTIFACT}.b3sum"
cp "${ARTIFACT}" .
cp "${ARTIFACT}.b3sum" .
tar -czvf "${ARCHIVE}" release/
b3sum "${ARCHIVE}" > "${ARCHIVE}.b3sum"
bash -c 'realpath "${ARTIFACT}" ; realpath "${ARCHIVE}"' | xargs -I "{}" bash -c \
'printf "\nFile: $(basename {})\n Type: $(file -b {})\n B3sum: $(b3sum {} | cut -d" " -f1)\n SHA256sum: $(sha256sum {} | cut -d" " -f1)\n Size: $(du -bh {} | cut -f1)\n"'

- name: Publish to GitHub (nightly)
uses: svenstaro/upload-release-action@v2
Expand All @@ -99,3 +113,11 @@ jobs:
tag: nightly
release_name: "${{ steps.version.outputs.version }}"
prerelease: true

- name: Attest Build Provenance
uses: actions/attest-build-provenance@v2.4.0
with:
subject-name: "soar-nightly-${{ matrix.build.NAME }}"
subject-path: |
soar-${{ matrix.build.NAME }}*
show-summary: true
78 changes: 50 additions & 28 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
name: soar release

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

on:
release:
types: [published]

workflow_dispatch:

permissions:
attestations: write
contents: write

id-token: write

jobs:
publish-binaries:
name: Publish binaries
Expand All @@ -15,18 +21,22 @@ jobs:
fail-fast: false
matrix:
build:
- {
NAME: x86_64-linux,
TARGET: x86_64-unknown-linux-musl,
}
- {
NAME: aarch64-linux,
TARGET: aarch64-unknown-linux-musl,
}
- {
NAME: loongarch64-linux,
TARGET: loongarch64-unknown-linux-musl
}
- {
NAME: riscv64-linux,
TARGET: riscv64gc-unknown-linux-musl
}
- {
NAME: x86_64-linux,
TARGET: x86_64-unknown-linux-musl,
}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -38,40 +48,44 @@ jobs:
- name: Install dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
--allow-unauthenticated musl-tools b3sum
sudo apt update -y
sudo apt install b3sum findutils file -y

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
targets: ${{ matrix.build.TARGET }}

- name: Install cross-compilation tools
uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.build.TARGET }}
- name: Install Cross
shell: bash
run: |
cargo install cross --git "https://github.com/cross-rs/cross" --jobs="$(($(nproc)+1))"
hash -r &>/dev/null
command -v cross &>/dev/null || { echo "cross command not found" >&2; exit 1; }

- name: Build
run: RUSTFLAGS="-C target-feature=+crt-static" cargo build --release --locked --target ${{ matrix.build.TARGET }}
env:
RUSTFLAGS: "-C target-feature=+crt-static \
-C link-self-contained=yes \
-C link-arg=-Wl,--build-id=none"
run: cross +nightly build --release --locked --target "${{ matrix.build.TARGET }}" --jobs="$(($(nproc)+1))" --verbose

- name: Prepare release assets
env:
ARTIFACT: "release/soar-${{ matrix.build.NAME }}"
ARCHIVE: "soar-${{ matrix.build.NAME }}.tar.gz"
shell: bash
run: |
mkdir -p release
cp {LICENSE,README.md,CHANGELOG.md} release/
cp "target/${{ matrix.build.TARGET }}/release/soar" release/

- name: Create release artifacts
shell: bash
run: |
cp release/soar soar-${{ matrix.build.NAME }}
b3sum soar-${{ matrix.build.NAME }} \
> soar-${{ matrix.build.NAME }}.b3sum
tar -czvf soar-${{ matrix.build.NAME }}.tar.gz \
release/
b3sum soar-${{ matrix.build.NAME }}.tar.gz \
> soar-${{ matrix.build.NAME }}.tar.gz.b3sum
cp {LICENSE,README.md} release/
cp "target/${{ matrix.build.TARGET }}/release/soar" "${ARTIFACT}"
b3sum "${ARTIFACT}" > "${ARTIFACT}.b3sum"
cp "${ARTIFACT}" .
cp "${ARTIFACT}.b3sum" .
tar -czvf "${ARCHIVE}" release/
b3sum "${ARCHIVE}" > "${ARCHIVE}.b3sum"
bash -c 'realpath "${ARTIFACT}" ; realpath "${ARCHIVE}"' | xargs -I "{}" bash -c \
'printf "\nFile: $(basename {})\n Type: $(file -b {})\n B3sum: $(b3sum {} | cut -d" " -f1)\n SHA256sum: $(sha256sum {} | cut -d" " -f1)\n Size: $(du -bh {} | cut -f1)\n"'

- name: Publish to GitHub
if: ${{ !contains(github.ref, '-') }}
Expand All @@ -96,3 +110,11 @@ jobs:
tag: ${{ github.ref }}
release_name: "Pre-release v${{ env.RELEASE_VERSION }}"
prerelease: true

- name: Attest Build Provenance
uses: actions/attest-build-provenance@v2.4.0
with:
subject-name: "soar-v${{ env.RELEASE_VERSION }}-${{ matrix.build.NAME }}"
subject-path: |
soar-${{ matrix.build.NAME }}*
show-summary: true
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ categories = ["command-line-utilities"]

[profile.release]
strip = true
opt-level = "z"
opt-level = 3
lto = true
codegen-units = 1
panic = "abort"
Expand Down
22 changes: 9 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<p align="center">
<a href="https://soar.qaidvoid.dev/installation">
<img src="https://soar.pkgforge.dev/gif?version=v0.6.3" alt="soar-list" width="750">
<img src="https://soar.pkgforge.dev/gif?version=v0.6.3+1" alt="soar-list" width="750">
</a><br>
</p>

Expand Down Expand Up @@ -99,21 +99,17 @@ wget -qO- "https://raw.githubusercontent.com/pkgforge/soar/main/install.sh" | sh
> - You can [self host](https://soar.qaidvoid.dev/configuration#custom-repository-support) your own repos if you need soar to run on other [supported hosts](https://docs.pkgforge.dev/sbuild/specification/20.x_exec#host).
> - Or you can also [sponsor us](https://github.com/pkgforge/soar#-sponsors) with Build Servers for CICD & Testing.

### 🏆 Tier 1 Hosts
_✅ --> Enabled by Default_

| 🤖 Host | 📦 Repos | ℹ️ Comment |
|------|----------|---------|
| **`aarch64-Linux`** | [**bincache**<sup>✅</sup>](https://docs.pkgforge.dev/repositories/bincache), [**pkgcache**<sup>✅</sup>](https://docs.pkgforge.dev/repositories/pkgcache), [**pkgforge-cargo**<sup>✅</sup>](https://docs.pkgforge.dev/repositories/external/pkgforge-cargo), [**pkgforge-go**<sup>✅</sup>](https://docs.pkgforge.dev/repositories/external/pkgforge-go), [cargo-bins](https://docs.pkgforge.dev/repositories/external/cargo-bins), [appimage-github-io](https://docs.pkgforge.dev/repositories/external/appimage-github-io), [appimagehub](https://docs.pkgforge.dev/repositories/external/appimagehub) | Almost as many packages as `x86_64-Linux`, fully supported |
| **`x86_64-Linux`** | [**bincache**<sup>✅</sup>](https://docs.pkgforge.dev/repositories/bincache), [**pkgcache**<sup>✅</sup>](https://docs.pkgforge.dev/repositories/pkgcache), [**pkgforge-cargo**<sup>✅</sup>](https://docs.pkgforge.dev/repositories/external/pkgforge-cargo), [**pkgforge-go**<sup>✅</sup>](https://docs.pkgforge.dev/repositories/external/pkgforge-go), [cargo-bins](https://docs.pkgforge.dev/repositories/external/cargo-bins), [ivan-hc-am](https://docs.pkgforge.dev/repositories/external/ivan-hc-am), [appimage-github-io](https://docs.pkgforge.dev/repositories/external/appimage-github-io), [appimagehub](https://docs.pkgforge.dev/repositories/external/appimagehub) | Primary target & most supported |
### 📀 Default Hosts

### 🥈 Tier 2 Hosts

| 🤖 Host | 📦 Repos | ℹ️ Comment |
|------|----------|---------|
| **`loongarch64-Linux`** | [**pkgforge-cargo**<sup>✅</sup>](https://docs.pkgforge.dev/repositories/external/pkgforge-cargo), [**pkgforge-go**<sup>✅</sup>](https://docs.pkgforge.dev/repositories/external/pkgforge-go) | Experimental & Least supported |
| **`riscv64-Linux`** | [**bincache**<sup>✅</sup>](https://docs.pkgforge.dev/repositories/bincache), [**pkgforge-cargo**<sup>✅</sup>](https://docs.pkgforge.dev/repositories/external/pkgforge-cargo), [**pkgforge-go**<sup>✅</sup>](https://docs.pkgforge.dev/repositories/external/pkgforge-go) | Experimental, with [gradual progress](https://github.com/pkgforge/soarpkgs/issues/198) |
> **Note:** _✅ --> Enabled by Default_

| 🏆 Tier | 🤖 Host | 📦 Repos | ℹ️ Status |
|---------|---------|---------------------------|-------------------|
| **Tier 1** | **`aarch64-Linux`** | [bincache<sup>✅</sup>](https://docs.pkgforge.dev/repositories/bincache), [pkgcache<sup>✅</sup>](https://docs.pkgforge.dev/repositories/pkgcache), [pkgforge-cargo<sup>✅</sup>](https://docs.pkgforge.dev/repositories/external/pkgforge-cargo), [pkgforge-go<sup>✅</sup>](https://docs.pkgforge.dev/repositories/external/pkgforge-go), [cargo-bins](https://docs.pkgforge.dev/repositories/external/cargo-bins), [appimage-github-io](https://docs.pkgforge.dev/repositories/external/appimage-github-io), [appimagehub](https://docs.pkgforge.dev/repositories/external/appimagehub) | Almost as many packages as `x86_64-Linux`, fully supported |
| **Tier 1** | **`x86_64-Linux`** | [bincache<sup>✅</sup>](https://docs.pkgforge.dev/repositories/bincache), [pkgcache<sup>✅</sup>](https://docs.pkgforge.dev/repositories/pkgcache), [pkgforge-cargo<sup>✅</sup>](https://docs.pkgforge.dev/repositories/external/pkgforge-cargo), [pkgforge-go<sup>✅</sup>](https://docs.pkgforge.dev/repositories/external/pkgforge-go), [cargo-bins](https://docs.pkgforge.dev/repositories/external/cargo-bins), [ivan-hc-am](https://docs.pkgforge.dev/repositories/external/ivan-hc-am), [appimage-github-io](https://docs.pkgforge.dev/repositories/external/appimage-github-io), [appimagehub](https://docs.pkgforge.dev/repositories/external/appimagehub) | Primary target & most supported |
| **Tier 2** | **`loongarch64-Linux`** | [pkgforge-cargo<sup>✅</sup>](https://docs.pkgforge.dev/repositories/external/pkgforge-cargo), [pkgforge-go<sup>✅</sup>](https://docs.pkgforge.dev/repositories/external/pkgforge-go) | Experimental & least supported |
| **Tier 2** | **`riscv64-Linux`** | [bincache<sup>✅</sup>](https://docs.pkgforge.dev/repositories/bincache), [pkgcache<sup>✅</sup>](https://docs.pkgforge.dev/repositories/pkgcache), [pkgforge-cargo<sup>✅</sup>](https://docs.pkgforge.dev/repositories/external/pkgforge-cargo), [pkgforge-go<sup>✅</sup>](https://docs.pkgforge.dev/repositories/external/pkgforge-go) | Experimental, with [gradual progress](https://github.com/pkgforge/soarpkgs/issues/198) |

## ☢️ Caveats

Expand Down
31 changes: 25 additions & 6 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -209,29 +209,48 @@ main() {
# Detect architecture
ARCH=$(uname -m)
case "$ARCH" in
x86_64)
ARCH="x86_64"
;;
aarch64)
ARCH="aarch64"
;;
loongarch64)
ARCH="loongarch64"
;;
riscv64)
ARCH="riscv64"
;;
x86_64)
ARCH="x86_64"
;;
*)
printf "${RED}Error: Unsupported architecture: ${YELLOW}$ARCH${RESET}\n" >&2
exit 1
;;
esac

# Detect OS
OS=$(uname -s)
case "$OS" in
Linux)
OS="linux"
;;
*)
printf "${RED}Error: Unsupported operating system: ${YELLOW}$OS${RESET}\n" >&2
printf "${RED}Only Linux is currently supported${RESET}\n" >&2
exit 1
;;
esac

# Get latest release URL
printf "Downloading Soar..."
case "$SOAR_VERSION" in
*nightly*)
RELEASE_URL="https://github.com/pkgforge/soar/releases/download/nightly/soar-$ARCH-linux"
RELEASE_URL="https://github.com/pkgforge/soar/releases/download/nightly/soar-$ARCH-$OS"
;;
*latest*)
RELEASE_URL="https://github.com/pkgforge/soar/releases/latest/download/soar-$ARCH-linux"
RELEASE_URL="https://github.com/pkgforge/soar/releases/latest/download/soar-$ARCH-$OS"
;;
*)
RELEASE_URL="https://github.com/pkgforge/soar/releases/download/v$SOAR_VERSION/soar-$ARCH-linux"
RELEASE_URL="https://github.com/pkgforge/soar/releases/download/v$SOAR_VERSION/soar-$ARCH-$OS"
;;
esac
printf " <== $RELEASE_URL\n"
Expand Down