diff --git a/.dockerignore b/.dockerignore deleted file mode 120000 index 3e4e48b..0000000 --- a/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -.gitignore \ No newline at end of file diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..1b04c5b --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,23 @@ +name: 'CI' +on: + push: + branches: + - toolchain + +# Jobs +jobs: + build: + name: Build + runs-on: ubuntu-latest + container: buildpack-deps:bullseye # Minimum Supported OS + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Setup + run: ./prepare.sh + - name: Build + run: ./build.sh + - name: Upload + run: ./upload.sh + env: + TOKEN: ${{ secrets.TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 0004792..cc750fa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /workspace /out +/archives diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 10f9349..0000000 --- a/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -FROM buildpack-deps:bullseye - -# Install Dependencies -RUN \ - apt-get update && \ - apt-get install -y \ - build-essential \ - g++-aarch64-linux-gnu \ - flex \ - texinfo \ - help2man \ - gawk \ - libtool-bin \ - bison && \ - rm -rf /var/lib/apt/lists/* - -# Copy Files -COPY . /data - -# Prepare -RUN /data/scripts/prepare.sh -CMD ["/data/scripts/build.sh"] \ No newline at end of file diff --git a/scripts/build.sh b/build.sh similarity index 88% rename from scripts/build.sh rename to build.sh index 0f7f7ab..f8650cd 100755 --- a/scripts/build.sh +++ b/build.sh @@ -1,11 +1,11 @@ #!/bin/sh set -e -cd "$(dirname "$0")/../" # Store Output OUT="$(pwd)/out" -mkdir -p "${OUT}" +rm -rf "${OUT}" +mkdir "${OUT}" # Build cd workspace/build diff --git a/scripts/prepare.sh b/prepare.sh similarity index 85% rename from scripts/prepare.sh rename to prepare.sh index 25f8be6..8af475a 100755 --- a/scripts/prepare.sh +++ b/prepare.sh @@ -1,7 +1,6 @@ #!/bin/sh set -e -cd "$(dirname "$0")/../" # Check if [ "$(uname -m)" != 'x86_64' ]; then @@ -9,6 +8,18 @@ if [ "$(uname -m)" != 'x86_64' ]; then exit 1 fi +# Install Dependencies +apt-get update +apt-get install -y \ + build-essential \ + g++-aarch64-linux-gnu \ + flex \ + texinfo \ + help2man \ + gawk \ + libtool-bin \ + bison + # Versions CT_NAME='crosstool-ng' CT_VERSION='1.27.0' diff --git a/run.sh b/run.sh deleted file mode 100755 index a36c13a..0000000 --- a/run.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -set -e -cd "$(dirname "$0")" - -# Build Image -TAG='arm-toolchain-build' -docker buildx build --tag "${TAG}" . - -# Run -rm -rf out -mkdir out -docker run \ - --rm \ - -u "$(id -u):$(id -g)" \ - -v "$(pwd)/out:/data/out" \ - "${TAG}" - -# Clean Up -docker image rm "${TAG}" \ No newline at end of file diff --git a/upload.sh b/upload.sh new file mode 100755 index 0000000..c9b9bae --- /dev/null +++ b/upload.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +# Setup Git +git config --global user.name 'gitea-actions' +git config --global user.email 'teabot@gitea.io' + +# Clone Repository +USER='TheBrokenRail' +git clone --depth 1 "https://${USER}:${TOKEN}@gitea.thebrokenrail.com/minecraft-pi-reborn/archives.git" -b master +cd archives + +# Copy +cp ../out/* . + +# Commit +git commit -m 'Update Toolchain' +git push \ No newline at end of file