mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-11-05 11:31:14 +00:00
6fde2d18a6
Stripping the release build for glibc shrinks the size considerably: $ du -h target/release/cloud-hypervisor 8.5M target/release/cloud-hypervisor $ strip target/release/cloud-hypervisor $ du -h target/release/cloud-hypervisor 5.2M target/release/cloud-hypervisor Signed-off-by: Rob Bradford <robert.bradford@intel.com>
68 lines
2.5 KiB
YAML
68 lines
2.5 KiB
YAML
name: Cloud Hypervisor Release
|
|
on: [create]
|
|
|
|
jobs:
|
|
release:
|
|
if: github.event_name == 'create' && github.event.ref_type == 'tag'
|
|
name: Release
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Code checkout
|
|
uses: actions/checkout@v2
|
|
- name: Install Rust toolchain (x86_64-unknown-linux-gnu)
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
target: x86_64-unknown-linux-gnu
|
|
- name: Install Rust toolchain (x86_64-unknown-linux-musl)
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
target: x86_64-unknown-linux-musl
|
|
- name: Build
|
|
run: cargo build --release --target=x86_64-unknown-linux-gnu
|
|
- name: Static Build
|
|
run: cargo build --release --target=x86_64-unknown-linux-musl
|
|
- name: Strip cloud-hypervisor binaries
|
|
run: strip target/*/release/cloud-hypervisor
|
|
- name: Create Release
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.ref }}
|
|
release_name: ${{ github.ref }}
|
|
draft: true
|
|
prerelease: true
|
|
- name: Upload cloud-hypervisor
|
|
id: upload-release-cloud-hypervisor
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: target/x86_64-unknown-linux-gnu/release/cloud-hypervisor
|
|
asset_name: cloud-hypervisor
|
|
asset_content_type: application/octet-stream
|
|
- name: Upload static cloud-hypervisor
|
|
id: upload-release-static-cloud-hypervisor
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: target/x86_64-unknown-linux-musl/release/cloud-hypervisor
|
|
asset_name: cloud-hypervisor-static
|
|
asset_content_type: application/octet-stream
|
|
- name: Upload ch-remote
|
|
id: upload-release-ch-remote
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: target/x86_64-unknown-linux-gnu/release/ch-remote
|
|
asset_name: ch-remote
|
|
asset_content_type: application/octet-stream
|