diff --git a/.github/workflows/build_visionfive2.yml b/.github/workflows/build_visionfive2.yml new file mode 100644 index 0000000..5f391b9 --- /dev/null +++ b/.github/workflows/build_visionfive2.yml @@ -0,0 +1,83 @@ +name: Visionfive2-Build-Fedora +on: + workflow_dispatch: + +jobs: + prepare_release: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Get time + id: time + uses: nanzm/get-time-action@v1.1 + with: + format: 'YYYYMMDD-HHmm' + - name: Create empty release + id: release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ steps.time.outputs.time }} + body_path: VERSION + token: ${{ secrets.GITHUB_TOKEN }} + target_commitish: main + draft: false + outputs: + release_id: ${{ steps.release.outputs.id }} + build: + runs-on: ubuntu-20.04 + needs: prepare_release + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Clean environment + env: + DEBIAN_FRONTEND: noninteractive + run: | + set +e + docker rmi `docker images -q` + echo "Deleting files, please wait ..." + sudo rm -rf \ + /usr/share/dotnet \ + /etc/mysql \ + /etc/php + sudo -E apt-get -y purge \ + azure-cli \ + ghc* \ + zulu* \ + hhvm \ + llvm* \ + firefox \ + google* \ + dotnet* \ + powershell \ + openjdk* \ + mysql* \ + php* + sudo -E apt-get update + sudo -E apt-get -y install build-essential gcc-riscv64-linux-gnu asciidoc binutils bzip2 gawk gettext git libncurses5-dev msmtp libssl-dev texinfo libglib2.0-dev + sudo -E apt-get -y install patch python2.7 unzip zlib1g-dev lib32gcc-s1 libc6-dev-i386 subversion flex node-uglify git gcc-multilib p7zip p7zip-full xmlto libreadline-dev + sudo -E apt-get -y install python3 python3-pip python3-pyelftools haveged lrzsz scons ecj fastjar re2c xz-utils tar binutils ccache curl wget vim nano rsync coreutils + sudo -E apt-get -y install qemu-utils upx-ucl libelf-dev autoconf automake libtool autopoint antlr3 gperf wget curl swig gcc g++ + sudo -E apt-get -y autoremove --purge + sudo -E apt-get clean + - name: Build + shell: bash + run: | + sudo bash build_visionfive2.sh + - name: Upload + if: needs.prepare_release.outputs.release_id != '' + uses: xresloader/upload-to-github-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + release_id: ${{ needs.prepare_release.outputs.release_id }} + file: "./*.img.xz*;./firmware/*u-boot-*.bin" + draft: false + - name: Rollback release + if: failure() && needs.prepare_release.outputs.release_id != '' + uses: author/action-rollback@stable + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + release_id: ${{ needs.prepare_release.outputs.release_id }}