From 33af60b7dbd2d9c58595d7fe732995f05ee5d786 Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Wed, 12 Jun 2024 17:35:34 +0200 Subject: [PATCH 1/2] Add entry to build.txt --- .github/workflows/compilation.yml | 5 +++-- .github/workflows/docker.yml | 1 + Dockerfile | 11 ++++++++++- toolchain.sh | 7 +++++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/compilation.yml b/.github/workflows/compilation.yml index 0a7f724..53e1fdb 100644 --- a/.github/workflows/compilation.yml +++ b/.github/workflows/compilation.yml @@ -18,8 +18,6 @@ jobs: ] fail-fast: false steps: - - uses: actions/checkout@v4 - - name: Install dependencies Alpine if: matrix.os[0] == 'alpine' run: | @@ -33,8 +31,11 @@ jobs: libarchive-devel openssl-devel gpgme-devel libtool gettext texinfo bison flex gmp-devel mpfr-devel libmpc-devel ncurses-devel \ diffutils glibc-gconv-extra xz + - uses: actions/checkout@v4 + - name: Compile Tools run: | + chown -R $(id -nu):$(id -ng) . export PSPDEV=$PWD/pspdev export PATH=$PATH:$PSPDEV/bin ./toolchain.sh diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index dbff243..db6b5c1 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -23,6 +23,7 @@ jobs: - uses: docker/build-push-action@v5 with: + context: . push: true tags: ghcr.io/${{ github.repository }}:latest build-args: | diff --git a/Dockerfile b/Dockerfile index b0632b7..abf671a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,9 +5,13 @@ ARG BASE_DOCKER_EXTRA_IMAGE # Allegrex stage of Dockerfile FROM $BASE_DOCKER_ALLEGREX_IMAGE +RUN mv ${PSPDEV}/build.txt ${PSPDEV}/build0.txt + # Extra stage of Dockerfile FROM $BASE_DOCKER_EXTRA_IMAGE +RUN mv ${PSPDEV}/build.txt ${PSPDEV}/build1.txt + # Second stage of Dockerfile FROM alpine:latest @@ -15,4 +19,9 @@ ENV PSPDEV /usr/local/pspdev ENV PATH $PATH:${PSPDEV}/bin COPY --from=0 ${PSPDEV} ${PSPDEV} -COPY --from=1 ${PSPDEV} ${PSPDEV} \ No newline at end of file +COPY --from=1 ${PSPDEV} ${PSPDEV} + +RUN cat ${PSPDEV}/build0.txt ${PSPDEV}/build1.txt > ${PSPDEV}/build.txt && \ + rm ${PSPDEV}/build0.txt ${PSPDEV}/build1.txt && \ + apk add --no-cache git && \ + git log -1 --format="psptoolchain %H %cs" >> ${PSPDEV}/build.txt diff --git a/toolchain.sh b/toolchain.sh index aaab6b4..63b0a01 100755 --- a/toolchain.sh +++ b/toolchain.sh @@ -46,3 +46,10 @@ else for SCRIPT in ${BUILD_SCRIPTS[@]}; do "$SCRIPT" "$TAG" || { echo "$SCRIPT: Failed."; exit 1; } done fi + +## Store build information +BUILD_FILE="${PSPDEV}/build.txt" +if [[ -f "${BUILD_FILE}" ]]; then + sed -i='' '/^psptoolchain /d' "${BUILD_FILE}" +fi +git log -1 --format="psptoolchain %H %cs" >> "${BUILD_FILE}" From 39ec01c3a295a55a8b60cc5f24b42a5cf04ce2a8 Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Sun, 16 Jun 2024 12:22:50 +0200 Subject: [PATCH 2/2] Add commit title to build.txt --- toolchain.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain.sh b/toolchain.sh index 63b0a01..30b10a7 100755 --- a/toolchain.sh +++ b/toolchain.sh @@ -52,4 +52,4 @@ BUILD_FILE="${PSPDEV}/build.txt" if [[ -f "${BUILD_FILE}" ]]; then sed -i='' '/^psptoolchain /d' "${BUILD_FILE}" fi -git log -1 --format="psptoolchain %H %cs" >> "${BUILD_FILE}" +git log -1 --format="psptoolchain %H %cs %s" >> "${BUILD_FILE}"