diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c110e76..f61ca59 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,23 +1,38 @@ name: Build RISC-V runner -on: [workflow_dispatch, pull_request] +on: [workflow_dispatch] jobs: - run: + build: runs-on: self-hosted steps: - name: Clone repositories run: | + rm -rf runner git clone -b dkurt/riscv64_runner https://github.com/dkurt/runner --depth 1 - name: Download .NET run: | - wget https://github.com/dkurt/dotnet_riscv/releases/download/v8.0.101/dotnet-sdk-8.0.101-linux-riscv64.tar.gz + wget -q https://github.com/dkurt/dotnet_riscv/releases/download/v8.0.101/dotnet-sdk-8.0.101-linux-riscv64.tar.gz + mkdir ${{ github.workspace }}/packages + cd ${{ github.workspace }}/packages + wget -q https://github.com/dkurt/dotnet_riscv/releases/download/v8.0.101/Microsoft.AspNetCore.App.Runtime.linux-riscv64.8.0.1-servicing.23580.8.nupkg + wget -q https://github.com/dkurt/dotnet_riscv/releases/download/v8.0.101/Microsoft.AspNetCore.App.Runtime.linux-riscv64.8.0.1-servicing.23580.8.symbols.nupkg + wget -q https://github.com/dkurt/dotnet_riscv/releases/download/v8.0.101/Microsoft.AspNetCore.App.Runtime.linux-riscv64.8.0.1.nupkg + wget -q https://github.com/dkurt/dotnet_riscv/releases/download/v8.0.101/Microsoft.AspNetCore.App.Runtime.linux-riscv64.8.0.1.symbols.nupkg + wget -q https://github.com/dkurt/dotnet_riscv/releases/download/v8.0.101/Microsoft.NETCore.App.Host.linux-riscv64.8.0.1.nupkg + wget -q https://github.com/dkurt/dotnet_riscv/releases/download/v8.0.101/Microsoft.NETCore.App.Host.linux-riscv64.8.0.1.symbols.nupkg + wget -q https://github.com/dkurt/dotnet_riscv/releases/download/v8.0.101/Microsoft.NETCore.App.Runtime.linux-riscv64.8.0.1-servicing.23580.1.nupkg + wget -q https://github.com/dkurt/dotnet_riscv/releases/download/v8.0.101/Microsoft.NETCore.App.Runtime.linux-riscv64.8.0.1-servicing.23580.1.symbols.nupkg + wget -q https://github.com/dkurt/dotnet_riscv/releases/download/v8.0.101/Microsoft.NETCore.App.Runtime.linux-riscv64.8.0.1.nupkg + wget -q https://github.com/dkurt/dotnet_riscv/releases/download/v8.0.101/Microsoft.NETCore.App.Runtime.linux-riscv64.8.0.1.symbols.nupkg - name: Prepare run: | cd runner + sed -i "s|/home/ubuntu/packages|${{ github.workspace }}|" src/NuGet.Config + mkdir -p _dotnetsdk/8.0.101 cd _dotnetsdk/8.0.101 tar -xf ${{ github.workspace }}/dotnet-sdk-8.0.101-linux-riscv64.tar.gz @@ -26,4 +41,8 @@ jobs: run: | cd runner/src ./dev.sh layout Release linux-riscv64 - + + - name: Package + run: | + cd runner/src + ./dev.sh package Release linux-riscv64 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6c5f34d..4c6fd28 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,6 +1,6 @@ name: Set of tests for Self-Hosted RISC-V runner -on: [workflow_dispatch, pull_request] +on: [workflow_dispatch] jobs: run: diff --git a/README.md b/README.md index 18ef8ae..66c4eb9 100644 --- a/README.md +++ b/README.md @@ -1 +1,34 @@ -# github_actions_riscv \ No newline at end of file +# GitHub Actions on RISC-V + +This repository provides a guide on how to build and use GitHub Actions (GitHub CI) on Self-Hosted RISC-V CPU machines. + +**Disclaimer**: this project is not related to GitHub or .NET development. Any instructions or binary packages published in the spirit of the open source. Use carefully. + +## Observed issues + +* The workspace is not cleaned +* `actions/upload-artifact` not working because of disabled Node.js (actually, ARM64 binaries were downloaded) + +## How to use + +Use a [pre-compiled](https://github.com/dkurt/github_actions_riscv/releases) version or follow the build steps from [build.yaml](.github/workflows/build.yaml). +Cross-compilation is not supported for now so build process is performed on RISC-V board which takes about 1 hour. + +After unpacking the runner archive, install .NET: +```bash +cd $HOME +wget https://github.com/dkurt/dotnet_riscv/releases/download/v8.0.101/dotnet-sdk-8.0.101-linux-riscv64.tar.gz + +sudo mkdir /usr/share/dotnet +cd /usr/share/dotnet +sudo tar -xf $HOME/dotnet-sdk-8.0.101-linux-riscv64.tar.gz +``` + +Verify .NET installation: +```bash +./dotnet --info +``` + +Then do `./config.sh` and `./run.sh` as recommended in your repository `Settings->Actions->Runners->New self-hosted runner` tab. + +Runner was tested on Sipeed Lichee RV Dock with [Ubuntu 23.10](https://ubuntu.com/download/risc-v).