linux-riscv64 dotnet-runtime build #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: linux-riscv64 dotnet-runtime build | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Remove unnecessary files | |
run: df -h; sudo rm -rf "$AGENT_TOOLSDIRECTORY"; df -h | |
- name: runtime+libs+packs build | |
run: | | |
git clone https://github.com/am11/runtime --single-branch --depth 1 -b feature/tests/published-crossgen2 | |
docker run --rm -v$(pwd)/runtime:/runtime -e ROOTFS_DIR=/crossrootfs/riscv64 \ | |
mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-riscv64-net9.0 \ | |
sh -c '/runtime/build.sh --cross --clang --arch riscv64 --configuration Release --subset host.native+clr.native+clr.corelib+clr.tools+clr.nativecorelib+clr.packages+clr.nativeaotlibs+clr.crossarchtools+libs /p:EnableSourceLink=false && | |
/runtime/build.sh --cross --clang --arch riscv64 --configuration Release --subset libs.tests --testscope all /p:EnableSourceLink=false /p:UseLocalAppHostPack=true && | |
rm -rf /runtime/artifacts/obj && | |
/runtime/src/tests/build.sh generatelayoutonly -log:Layout -Release -cross -riscv64 -p:UseLocalAppHostPack=true && | |
/runtime/src/tests/build.sh -Release -cross -riscv64 -clang -priority1 -p:UseLocalAppHostPack=true && | |
rm -rf ../runtime/artifacts/obj' | |
- name: Upload artifacts | |
run: | | |
sudo apt install -y hub | |
# hub(1) requires release to be created inside a git repo | |
git clone https://${{ secrets.CLONE_TOKEN }}:x-oauth-basic@github.com/${{ github.repository }}.git repo | |
cd repo | |
tar czf artifacts.tar.gz ../runtime/artifacts | |
du -sh artifacts.tar.gz | |
du -b artifacts.tar.gz | |
# Split the tar.gz file into 1.5 GB chunks | |
split -b 1536M artifacts.tar.gz artifacts_part_ | |
# Initialize the artifacts variable | |
artifacts="" | |
# Loop over the split files and append each one to the artifacts variable | |
for chunk in artifacts_part_* | |
do | |
artifacts+=" -a ${chunk}" | |
done | |
tag_name="linux-riscv64_$GITHUB_RUN_ID" | |
hub release create $artifacts -m "$tag_name" "$tag_name" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |