mirror of
https://github.com/n0-computer/iroh.git
synced 2026-12-03 08:01:40 +00:00
feat: release builds (#863)
This commit is contained in:
@@ -90,6 +90,102 @@ jobs:
|
||||
command: test
|
||||
args: --all --target ${{ matrix.target }}
|
||||
|
||||
build_release:
|
||||
name: Build release binaries
|
||||
runs-on: ${{ matrix.runner }}
|
||||
continue-on-error: false
|
||||
needs: build_and_test_nix
|
||||
if: ${{ always() && github.ref_name=='main' }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
name: [ubuntu-latest, ubuntu-arm-latest, macOS-latest, macOS-arm-latest]
|
||||
rust: [stable]
|
||||
experimental: [false]
|
||||
include:
|
||||
- name: ubuntu-arm-latest
|
||||
os: ubuntu-latest
|
||||
release-os: linux
|
||||
release-arch: aarch64
|
||||
runner: [self-hosted, linux, ARM64]
|
||||
- name: ubuntu-latest
|
||||
os: ubuntu-latest
|
||||
release-os: linux
|
||||
release-arch: amd64
|
||||
runner: [self-hosted, linux, X64]
|
||||
- name: macOS-latest
|
||||
os: macOS-latest
|
||||
release-os: darwin
|
||||
release-arch: x86_64
|
||||
runner: [self-hosted, macOS, X64]
|
||||
- name: macOS-arm-latest
|
||||
os: macOS-latest
|
||||
release-os: darwin
|
||||
release-arch: aarch64
|
||||
runner: [self-hosted, macOS, ARM64]
|
||||
# - os: windows-latest
|
||||
# release-os: windows
|
||||
# release-arch: amd64
|
||||
# runner: [windows-latest]
|
||||
env:
|
||||
RUST_BACKTRACE: full
|
||||
RUSTV: ${{ matrix.rust }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Set build arch
|
||||
run: |
|
||||
echo "RELEASE_ARCH=${{ matrix.release-arch }}" >> $GITHUB_ENV
|
||||
echo "RELEASE_OS=${{ matrix.release-os }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Install ${{ matrix.rust }}
|
||||
run: |
|
||||
rustup toolchain install ${{ matrix.rust }}
|
||||
|
||||
- name: build release
|
||||
run: |
|
||||
cargo build --profile optimized-release
|
||||
|
||||
- name: Setup awscli on linux
|
||||
if: matrix.name == 'ubuntu-latest'
|
||||
run: |
|
||||
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
|
||||
unzip awscliv2.zip
|
||||
sudo ./aws/install --update
|
||||
|
||||
- name: Setup awscli on linux
|
||||
if: matrix.name == 'ubuntu-arm-latest'
|
||||
run: |
|
||||
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"
|
||||
unzip awscliv2.zip
|
||||
sudo ./aws/install --update
|
||||
|
||||
- name: Setup awscli on mac
|
||||
if: matrix.os == 'macos-latest'
|
||||
run: |
|
||||
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
|
||||
sudo installer -pkg AWSCLIV2.pkg -target /
|
||||
|
||||
- name: Set aws credentials
|
||||
if: matrix.os != 'windows-latest'
|
||||
run: |
|
||||
echo "AWS_ACCESS_KEY_ID=${{secrets.S3_ACCESS_KEY_ID}}" >> $GITHUB_ENV
|
||||
echo "AWS_SECRET_ACCESS_KEY=${{secrets.S3_ACCESS_KEY}}" >> $GITHUB_ENV
|
||||
echo "AWS_DEFAULT_REGION=us-west-2" >> $GITHUB_ENV
|
||||
|
||||
- name: push release
|
||||
if: matrix.os != 'windows-latest'
|
||||
run: |
|
||||
aws s3 cp ./target/optimized-release/iroh s3://vorc/iroh-${RELEASE_OS}-${RELEASE_ARCH}-${GITHUB_SHA::7} --no-progress
|
||||
|
||||
- name: push release latest
|
||||
if: matrix.os != 'windows-latest'
|
||||
run: |
|
||||
aws s3 cp ./target/optimized-release/iroh s3://vorc/iroh-${RELEASE_OS}-${RELEASE_ARCH}-latest --no-progress
|
||||
|
||||
cross:
|
||||
name: Cross compile
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -67,3 +67,11 @@ test = []
|
||||
[[bin]]
|
||||
name = "iroh"
|
||||
required-features = ["cli"]
|
||||
|
||||
[profile.optimized-release]
|
||||
inherits = 'release'
|
||||
lto = true
|
||||
debug-assertions = false
|
||||
opt-level = 3
|
||||
panic = 'abort'
|
||||
incremental = false
|
||||
Reference in New Issue
Block a user