Diff

Differences From Artifact [46b4f35d88]:

To Artifact [e5e03bff2f]:


     1      1   #! /usr/bin/env bash
            2  +
            3  +upload='false'
            4  +for arg in "$@"; do
            5  +	case "${arg}" in
            6  +		--help)
            7  +			echo "Usage: build-precompiled [--upload]"
            8  +			exit 0
            9  +			;;
           10  +		--upload)
           11  +			upload='true'
           12  +			;;
           13  +		*)
           14  +			echo "Invalid argument \"${arg}\"" >&2
           15  +			exit 1
           16  +			;;
           17  +	esac
           18  +done
     2     19   
     3     20   # Ensure we are in the correct working directory
     4     21   cd "$(dirname "$(which "$0")")/.." || exit 1
     5     22   
     6     23   # Determine the version of Filed
     7     24   version=''
     8     25   eval "$(( grep '^# *define  *FILED_VERSION' filed.c; echo '|version=FILED_VERSION' ) | cpp -E | grep '^|' | sed 's@^|@@')"
................................................................................
    50     67   done
    51     68   
    52     69   # Wait for that to get done
    53     70   wait
    54     71   
    55     72   # Rename the files into place
    56     73   mkdir -p compiled
           74  +binaries=()
    57     75   for binary in workdir-buildPrecompiled-*/filed; do
    58     76   	platform="$(echo "${binary}" | sed 's@^.*-platform-@@;s@/.*$@@')"
    59         -	mv "${binary}" "compiled/filed-${version}-${platform}"
           77  +	binary_dest="compiled/filed-${version}-${platform}"
           78  +	mv "${binary}" "${binary_dest}"
           79  +	binaries+=("${binary_dest}")
    60     80   done
           81  +
           82  +if [ "${upload}" = 'true' ]; then
           83  +	for binary in "${binaries[@]}"; do
           84  +		fossil uv add "${binary}" --as "releases/${version}/$(basename "${binary}")"
           85  +	done
           86  +fi
    61     87   
    62     88   # Cleanup
    63     89   rm -rf workdir-buildPrecompiled-*
    64     90   
    65     91   exit 0