diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 183d8e3..4e1bc64 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,8 @@ stages: - release -Test: + +Linux: stage: test allow_failure: true tags: @@ -15,11 +16,47 @@ Test: - apt-get -y install build-essential curl jq make python3 python3-dev python3-pip wget unzip git - make fetch - sh -c "./scripts/check-patchfail.sh" - - make test + - make test-linux artifacts: paths: - librewolf-*.tar.bz2 +macOS: + stage: test + allow_failure: true + when: manual + tags: + - autoscale + image: debian + script: + - apt-get update && apt-get -y upgrade + - apt-get -y install build-essential curl jq make python3 python3-dev python3-pip wget unzip git + - make fetch + - sh -c "./scripts/check-patchfail.sh" + - make test-macos + artifacts: + paths: + - librewolf-*.dmg + +Windows: + stage: test + allow_failure: true + when: manual + tags: + - autoscale + image: debian + script: + - apt-get update && apt-get -y upgrade + - apt-get -y install build-essential curl jq make python3 python3-dev python3-pip wget unzip git + - make fetch + - sh -c "./scripts/check-patchfail.sh" + - make test-windows + artifacts: + paths: + - librewolf-*.zip + + + Build: diff --git a/Makefile b/Makefile index cf3d0b5..c137cd0 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ docker_targets=docker-build-image docker-run-build-job docker-remove-image woodpecker_targets=fetch-upstream-woodpecker check-patchfail-woodpecker -testing_targets=full-test test +testing_targets=full-test test test-linux test-macos test-windows .PHONY : help check all clean veryclean dir bootstrap fetch build package run update setup-wasi check-patchfail check-fuzz fixfuzz $(docker_targets) $(woodpecker_targets) $(testing_targets) version:=$(shell cat ./version) @@ -195,3 +195,11 @@ test : full-test # full-test: produce the bz2 artifact using bsys6 from scratch full-test : $(lw_source_tarball) ${MAKE} -f assets/testing.mk bsys6_x86_64_linux_bz2_artifact + +test-linux : full-test + +test-macos : $(lw_source_tarball) + ${MAKE} -f assets/testing.mk bsys6_x86_64_macos_dmg_artifact + +test-windows : $(lw_source_tarball) + ${MAKE} -f assets/testing.mk bsys6_x86_64_windows_zip_artifact diff --git a/assets/testing.mk b/assets/testing.mk index d6ad4bc..9da7d85 100644 --- a/assets/testing.mk +++ b/assets/testing.mk @@ -1,4 +1,4 @@ -.PHONY : bsys6_x86_64_linux_bz2_artifact full_build_stage2 +.PHONY : bsys6_x86_64_linux_bz2_artifact full_build_stage2_linux bsys6_x86_64_macos_dmg_artifact full_build_stage2_macos bsys6_x86_64_windows_zip_artifact full_build_stage2_windows # # This makefile just uses bsys6 to build the package @@ -15,14 +15,14 @@ bsys6_x86_64_linux_bz2_artifact : rm -rf bsys6 git clone "https://codeberg.org/librewolf/bsys6.git" - (cd bsys6 && ${MAKE} -f ../assets/testing.mk full_build_stage2) + (cd bsys6 && ${MAKE} -f ../assets/testing.mk full_build_stage2_linux) cp -v bsys6/*.bz2 . rm -rf bsys6 -full_build_stage2: +full_build_stage2_linux: - echo "[debug] Starting full_build_stage2" + echo "[debug] Starting full_build_stage2_linux" echo "VERSION=$$(cat ../version)-$$(cat ../release)" > env.sh echo "WORKDIR=$$(pwd)/WORKDIR" >> env.sh @@ -37,7 +37,82 @@ full_build_stage2: (cd SOURCEDIR && tar xf ../../librewolf*.tar.gz) - ARCH=x86_64 ./bsys6 prepare - ARCH=x86_64 ./bsys6 package + TARGET=linux ARCH=x86_64 ./bsys6 prepare + TARGET=linux ARCH=x86_64 ./bsys6 package + + @echo "[debug] Done full_build_stage2_linux" + + + +# +# This code below is just block-copied from the linux case. +# + + + +bsys6_x86_64_macos_dmg_artifact : + + rm -rf bsys6 + git clone "https://codeberg.org/librewolf/bsys6.git" + (cd bsys6 && ${MAKE} -f ../assets/testing.mk full_build_stage2_macos) + cp -v bsys6/*.dmg . + rm -rf bsys6 + + +full_build_stage2_macos: + + echo "[debug] Starting full_build_stage2_macos" + + echo "VERSION=$$(cat ../version)-$$(cat ../release)" > env.sh + echo "WORKDIR=$$(pwd)/WORKDIR" >> env.sh + echo "TARGET=macos" >> env.sh + echo "ARCH=x86_64" >> env.sh + echo "SOURCEDIR=$$(pwd)/SOURCEDIR/librewolf-$$(cat ../version)-$$(cat ../release)" >> env.sh + cat env.sh + + + mkdir WORKDIR + mkdir SOURCEDIR + (cd SOURCEDIR && tar xf ../../librewolf*.tar.gz) + + + TARGET=macos ARCH=x86_64 ./bsys6 prepare + TARGET=macos ARCH=x86_64 ./bsys6 package + + @echo "[debug] Done full_build_stage2_macos" + + + + +bsys6_x86_64_windows_zip_artifact : + + rm -rf bsys6 + git clone "https://codeberg.org/librewolf/bsys6.git" + (cd bsys6 && ${MAKE} -f ../assets/testing.mk full_build_stage2_windows) + cp -v bsys6/*.zip . + rm -rf bsys6 + + +full_build_stage2_windows: + + echo "[debug] Starting full_build_stage2_windows" + + echo "VERSION=$$(cat ../version)-$$(cat ../release)" > env.sh + echo "WORKDIR=$$(pwd)/WORKDIR" >> env.sh + echo "TARGET=windows" >> env.sh + echo "ARCH=x86_64" >> env.sh + echo "SOURCEDIR=$$(pwd)/SOURCEDIR/librewolf-$$(cat ../version)-$$(cat ../release)" >> env.sh + cat env.sh + + + mkdir WORKDIR + mkdir SOURCEDIR + (cd SOURCEDIR && tar xf ../../librewolf*.tar.gz) + + + TARGET=windows ARCH=x86_64 ./bsys6 prepare + TARGET=windows ARCH=x86_64 ./bsys6 package + + @echo "[debug] Done full_build_stage2_windows" + - @echo "[debug] Done full_build_stage2"