include: - project: 'bavison/ci' file: '/builder.yml' deploy: stage: deploy only: refs: [ master ] tags: [ cross ] script: # Depending on whether the pipeline is launched by the merge request or # manually, VersionNum may or may not have been updated. Switch to the # tip of master to ensure consistency. - git checkout origin/master - SOURCETAG=$(git describe --abbrev=8 --tags --always) # As soon as the CI stuff is merged into the central project, update group and branch identifiers. - 'curl --location --output RiscOS.zip "https://gitlab.riscosopen.org/bavison/BuildHost/-/jobs/artifacts/ci/download?job=latest_package_tree"' - unzip -q RiscOS.zip - shopt -s expand_aliases && source RiscOS/Env/ROOL/BuildHost.sh - git clone https://gitbot:$PASSWORD@gitlab.riscosopen.org/gitbot/PlingBuilder - make links - ln -s ../PlingBuilder objs/!Builder - COMPONENT=Builder TARGET=Builder INSTDIR=. make install # If the installed binary has changed in any way, then... # - if major version number is unchanged, then do an untagged merge request # (most likely this means there have been toolchain and/or library # changes since the binary was last imported) # - otherwise, create a VersionNum file that is 0.01 behind the source # component, and let the srccommit instance that runs during the merge # bring the source and binary versions back to parity - cd PlingBuilder && git diff --quiet --exit-code || ( git checkout -b Import$(echo $SOURCETAG | sed -e 's/[.-_]//g'); if diff <(head -1 ../VersionNum) <(head -1 VersionNum) &> /dev/null; then git add .; git commit -m "Binary import from source version "$SOURCETAG$'\n!NoTag'; else NEXTVER=$(sed $'1s/^.*(\\(.*\\)).*$/\\1/;t\nd' ../VersionNum); INTVER=${NEXTVER%%.*}; FRACVER=${NEXTVER#*.}; FRACVER=${FRACVER#0}; if [ $FRACVER = 0 ]; then INTVER=$((INTVER-1)); FRACVER=99; else FRACVER=$((FRACVER-1)); fi; PREVER=$(printf "%d.%02d" $INTVER $FRACVER); echo "($PREVER)" > VersionNum; git add .; git commit -m "Binary import from source version "$SOURCETAG; fi; git push -o merge_request.create origin )