Skip to content
This repository was archived by the owner on Mar 6, 2023. It is now read-only.

Commit 5b088d1

Browse files
committed
Simplify build process: No more docker; GH Actions instead of CircleCI
1 parent 97187a9 commit 5b088d1

File tree

5 files changed

+84
-121
lines changed

5 files changed

+84
-121
lines changed

.circleci/config.yml

Lines changed: 0 additions & 77 deletions
This file was deleted.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Build RISC-V GCC
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
7+
jobs:
8+
build-risc-v-gcc:
9+
runs-on: ubuntu-20.04
10+
11+
steps:
12+
- name: Install dependencies
13+
run: |
14+
sudo apt-get update
15+
sudo apt-get upgrade -y
16+
sudo apt-get install -y autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev git
17+
18+
- name: Clone riscv/riscv-gnu-toolchain
19+
run: |
20+
git clone --recursive --jobs 16 --quiet https://github.com/riscv/riscv-gnu-toolchain
21+
22+
- name: Configure
23+
run: |
24+
cd riscv-gnu-toolchain
25+
./configure --prefix=/opt/modm-riscv-gcc --enable-multilib
26+
27+
- name: Build
28+
run: |
29+
cd riscv-gnu-toolchain
30+
make -j8
31+
32+
- name: Compiling test files
33+
run: |
34+
/opt/modm-riscv-gcc/bin/riscv64-unknown-elf-g++ --version
35+
echo "int main() { return 0;}" > main1.cpp
36+
/opt/modm-riscv-gcc/bin/riscv64-unknown-elf-g++ main1.cpp
37+
38+
#- name: Fake toolchain
39+
# run: |
40+
# mkdir -p /opt/riscv-gcc/bin
41+
# cp $(which true) /opt/riscv-gcc/bin/riscv64-unknown-elf-g++
42+
43+
- name: Create tarball
44+
run: |
45+
tar cjf modm-riscv-gcc.tar.bz2 -C /opt modm-riscv-gcc
46+
47+
- name: Upload artifact
48+
uses: actions/upload-artifact@v2
49+
with:
50+
name: modm-riscv-gcc
51+
path: modm-riscv-gcc.tar.bz2
52+
53+
- name: Create release
54+
if: startsWith(github.ref, 'refs/tags/')
55+
id: create_release
56+
uses: actions/create-release@v1
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
with:
60+
tag_name: ${{ github.ref }}
61+
release_name: RISC-V GCC ${{ github.ref }}
62+
draft: false
63+
prerelease: false
64+
65+
- name: Upload release asset
66+
if: startsWith(github.ref, 'refs/tags/')
67+
uses: actions/upload-release-asset@v1
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
with:
71+
upload_url: ${{ steps.create_release.outputs.upload_url }}
72+
asset_path: ./modm-riscv-gcc.tar.bz2
73+
asset_name: modm-riscv-gcc.tar.bz2
74+
asset_content_type: application/x-bzip2

Dockerfile

Lines changed: 0 additions & 11 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# Up-to-date RISC-V GNU GCC Toolchain from source
22

3-
[![CircleCI](https://circleci.com/gh/modm-ext/riscv-gcc.svg?style=svg)](https://circleci.com/gh/modm-ext/riscv-gcc)
4-
53
## Installation
64

7-
Download the latest `modm-riscv-gcc.tar.bz2` from [Releases](https://github.com/modm-ext/docker-riscv-gcc/releases)
5+
Download the latest `modm-riscv-gcc.tar.bz2` from [Releases](https://github.com/modm-io/riscv-gcc/releases)
86
and unpack it to `/opt`:
97

108
```sh
@@ -18,40 +16,14 @@ e.g. by adding the following line to your `~/.bashrc` file:
1816
export PATH="/opt/modm-riscv-gcc/bin:$PATH"
1917
```
2018

21-
## Building locally with Docker
22-
23-
There is a Docker image with all prerequisites for building, created from the `Dockerfile` in this repository.
24-
Pull and start the image from Dockerhub with:
25-
26-
```sh
27-
docker run -it modm/riscv-gcc-prerequisites
28-
```
29-
30-
Or build the image from the local `Dockerfile` and start it:
31-
32-
```sh
33-
docker build --tag riscv-gcc-prerequisites:local .
34-
docker run -it riscv-gcc-prerequisites:local
35-
```
36-
37-
Inside the Docker container get this repository
19+
## Building local
3820

39-
```sh
40-
git clone https://github.com/modm-ext/docker-riscv-gcc.git
41-
```
21+
The build script is written for Ubuntu 20.04.
4222

43-
Run the build.sh script
23+
Just run the build.sh script:
4424

4525
```sh
46-
cd docker-riscv-gcc
47-
time ./build.sh
26+
./build.sh
4827
```
4928

5029
The toolchain will be in `/opt/modm-riscv-gcc`.
51-
52-
## Building in CircleCI
53-
54-
There is a CircleCI job defined in `.circleci/config.yml` which builds the
55-
toolchain using the Docker container. For tagged commits, a Github release
56-
will be created with the toolchain put into a downloadable `.tar.bz2` at
57-
[Releases](https://github.com/modm-ext/docker-riscv-gcc/releases).

build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/usr/bin/env bash
22

3+
# Install dependencies
4+
sudo apt-get update
5+
sudo apt-get upgrade -y
6+
sudo apt-get install -y autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev git
7+
38
# Get sources
49
git clone --recursive https://github.com/riscv/riscv-gnu-toolchain
510
cd riscv-gnu-toolchain

0 commit comments

Comments
 (0)