Setup CI
Some checks failed
CI / Build (push) Failing after 20s

This commit is contained in:
TheBrokenRail 2025-03-20 15:21:58 -04:00
parent e1bcc2a2a3
commit 04eb9f8a18
8 changed files with 57 additions and 46 deletions

View File

@ -1 +0,0 @@
.gitignore

View File

@ -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 }}

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/workspace /workspace
/out /out
/archives

View File

@ -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"]

View File

@ -1,11 +1,11 @@
#!/bin/sh #!/bin/sh
set -e set -e
cd "$(dirname "$0")/../"
# Store Output # Store Output
OUT="$(pwd)/out" OUT="$(pwd)/out"
mkdir -p "${OUT}" rm -rf "${OUT}"
mkdir "${OUT}"
# Build # Build
cd workspace/build cd workspace/build

View File

@ -1,7 +1,6 @@
#!/bin/sh #!/bin/sh
set -e set -e
cd "$(dirname "$0")/../"
# Check # Check
if [ "$(uname -m)" != 'x86_64' ]; then if [ "$(uname -m)" != 'x86_64' ]; then
@ -9,6 +8,18 @@ if [ "$(uname -m)" != 'x86_64' ]; then
exit 1 exit 1
fi fi
# Install Dependencies
apt-get update
apt-get install -y \
build-essential \
g++-aarch64-linux-gnu \
flex \
texinfo \
help2man \
gawk \
libtool-bin \
bison
# Versions # Versions
CT_NAME='crosstool-ng' CT_NAME='crosstool-ng'
CT_VERSION='1.27.0' CT_VERSION='1.27.0'

20
run.sh
View File

@ -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}"

19
upload.sh Executable file
View File

@ -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