Skip to content

Commit

Permalink
fix env exports + #dev markers
Browse files Browse the repository at this point in the history
  • Loading branch information
humbletim committed Jul 28, 2022
1 parent 01a81d1 commit b597937
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 30 deletions.
36 changes: 24 additions & 12 deletions .github/fsenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,33 @@ function _fsenv() {

# setenv <name> [default-value]
# exports the named variable and emits a key="value" to stdout
# (a no-op when the variable doesn't exist and no default is specified)
# (a no-op when both the variable doesn't exist and no default is specified)
function setenv() {
if [[ ! ${!1+x} ]] ; then
if [[ $# -lt 2 ]] ; then return 0 ; fi
eval "export ${1}=\"$2\""
# var not present assign to default and export
printf -v "${1}" "%s" "${2}"
fi
if [[ ${!1} == *$'\n'* ]] ; then
# bash and github action multiline env vars compat
echo "${1}<<EOF"
echo "${!1}"
echo "EOF"
emitvar "$@"
}

function emitvar() {
if [[ ${GITHUB_ACTIONS+x} ]] ; then
# output github action (GITHUB_ENV) compatible multiline/escaped variables
if [[ ${!1} == *$'\n'* ]] ; then
echo "${1}<<EOF"
echo "${!1}"
echo "EOF"
else
echo "${1}=${!1}"
fi
else
echo "${1}=${!1}"
# output bash compatible multiline/escaped variables
declare -p "${1}"
fi
}

setenv GHA_TEST_WITH_SPACES "testing 1 2 3...tab\t."
setenv _3P_UTILSDIR "$(cd $(dirname $0)/3p && pwd)"
setenv GHA_TEST_WITH_SPACES "testing \"1\" 2 3...tab\t."

############################################################################
# workaround for github actions receiving 403: Forbidden errors when trying to
Expand All @@ -37,7 +46,7 @@ function _fsenv() {
### :/ also 403's with vcs.firestormviewer.org...
### setenv INLINE_FS3P_GITURL https://vcs.firestormviewer.org/3p-libraries

# format: packagerepo=gitcommit
# format: packagerepo@gitcommit[#alias]
setenv INLINE_FS3P_DEPS "
holostorm/3p-discord-rpc@a21e3dc#3p-discord-rpc
holostorm/3p-ndPhysicsStub@aad4d9e
Expand All @@ -63,13 +72,16 @@ function _fsenv() {
# https://bitbucket.org/kokua/3p-ndPhysicsStub/downloads/ndPhysicsStub-1.0-windows64-203290044.tar.bz2=bd172f8cf47ce5ba53a4d4128b2580d5
############################################################################

### AUTOBUILD_ environment variables
if [[ ! ${GITHUB_WORKSPACE+x} ]] ; then
case `uname -s` in
MINGW*) local GITHUB_WORKSPACE=$(pwd -W) ;;
*) local GITHUB_WORKSPACE=$PWD ;;
esac
fi
setenv _3P_UTILSDIR ${GITHUB_WORKSPACE}/.github/3p

### AUTOBUILD_ environment variables

setenv AUTOBUILD_VARIABLES_FILE ${GITHUB_WORKSPACE}/fs-build-variables/variables
setenv AUTOBUILD_CONFIG_FILE ${GITHUB_WORKSPACE}/autobuild.xml
setenv AUTOBUILD_INSTALLABLE_CACHE ${GITHUB_WORKSPACE}/autobuild-cache
Expand Down
42 changes: 24 additions & 18 deletions .github/workflows/CompileWindows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ jobs:
submodules: true
- name: Preset ENV
shell: bash
run: .github/fsenv.sh | tee -a $GITHUB_ENV
run: |
.github/fsenv.sh | tee -a $GITHUB_ENV
if [[ ! ${GITHUB_ACTIONS+x} ]] ; then #dev
set -ea && source <( .github/fsenv.sh ) && set +ea && test -n "$VIEWER_CHANNEL" -a -n "$FSBUILD_DIR" -a -n "$AUTOBUILD_VSVER" #dev
fi #dev
- name: Prep build dirs
shell: cmd
run: |
Expand Down Expand Up @@ -62,10 +66,15 @@ jobs:
with:
python-version: 3.8
architecture: x64
- name: Workaround Firestorm Python.cmake
run: |
export PYTHON_EXECUTABLE=$(cygpath -ms "`which python`") #dev
echo PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} | tee -a $GITHUB_ENV
- name: Get software versions please
shell: cmd
run: |
echo AUTOBUILD_INSTALLABLE_CACHE='%AUTOBUILD_INSTALLABLE_CACHE%'
echo PYTHON_EXECUTABLE='%PYTHON_EXECUTABLE%'
cmake --version
git --version
python --version
Expand All @@ -75,10 +84,12 @@ jobs:
echo " "
df -h
- name: Install autobuild through PIP
run: pip install 'git+https://bitbucket.org/lindenlab/autobuild.git#egg=autobuild'
run: |
which autobuild || pip install 'git+https://bitbucket.org/lindenlab/autobuild.git#egg=autobuild' #dev
- name: generate sorted 3p-inline manifest
shell: bash
run: for x in $INLINE_FS3P_DEPS ; do echo $x ; done | sort -u | tee 3p-inline.sorted.txt
run: |
for x in $INLINE_FS3P_DEPS ; do echo $x ; done | sort -u | tee 3p-inline.sorted.txt
- name: cache -- 3p-inline
id: cached-3p-inline
uses: actions/cache@v2
Expand All @@ -91,7 +102,7 @@ jobs:
# if: steps.cached-3p-inline.outputs.cache-hit != 'true'
shell: bash
run: |
.github/3p/CompileWindows.autobuild-setup.sh
.github/3p/CompileWindows.autobuild-setup.sh #dev
test -f autobuild.xml.sorted.txt
- name: cache -- autobuild downloads
Expand All @@ -111,38 +122,33 @@ jobs:
- name: Reset cached packages sentinels
# if: steps.cached-buildir-packages.outputs.cache-hit == 'true'
shell: bash
working-directory: ${{ env.FSBUILD_DIR }}
run: |
sleep 2 && touch ./packages/cmake_tracking/sentinel_installed || true
sleep 2 && touch `ls ./packages/cmake_tracking/*_installed | fgrep -v sentinel_installed` || true
ls -lrt ../autobuild.xml ./packages/cmake_tracking/*_installed || true
.github/fs_reset_sentinels.sh ${FSBUILD_DIR} #dev
ls -lrt autobuild.xml ${FSBUILD_DIR}/packages/cmake_tracking/*_installed || true
- name: Configure autobuild (ninja)
if: ${{ github.event.inputs.buildsys == 'ninja' }}
shell: bash
run: |
autobuild --version
autobuild configure -- --no-vstools --ninja --package --openal --chan ${VIEWER_CHANNEL} -DLL_TESTS:BOOL=FALSE -DVS_DISABLE_FATAL_WARNINGS=ON
test -n "${VIEWER_CHANNEL}" && test -n "${PYTHON_EXECUTABLE}" #dev
autobuild configure -- --no-vstools --ninja --package --openal --chan "${VIEWER_CHANNEL}" -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -DLL_TESTS:BOOL=FALSE -DVS_DISABLE_FATAL_WARNINGS=ON #dev
- name: Build plugins (ninja)
if: ${{ github.event.inputs.buildsys == 'ninja' && github.event.inputs.llpackage == 'true' }}
working-directory: ${{ env.FSBUILD_DIR }}
run: |
ninja SLPlugin media_plugin_cef media_plugin_libvlc
ninja -C ${FSBUILD_DIR} SLPlugin media_plugin_cef media_plugin_libvlc #dev
- name: Build precompiled header (ninja)
if: ${{ github.event.inputs.buildsys == 'ninja' && github.event.inputs.llpackage == 'true' }}
working-directory: ${{ env.FSBUILD_DIR }}
run: |
ninja newview/CMakeFiles/firestorm-bin.dir/llviewerprecompiledheaders.cpp.obj
ninja -C ${FSBUILD_DIR} newview/CMakeFiles/firestorm-bin.dir/llviewerprecompiledheaders.cpp.obj #dev
- name: Build firestorm-bin (ninja)
if: ${{ github.event.inputs.buildsys == 'ninja' && github.event.inputs.llpackage == 'true' }}
working-directory: ${{ env.FSBUILD_DIR }}
run: |
ninja firestorm-bin
ninja -C ${FSBUILD_DIR} firestorm-bin #dev
- name: Package (ninja)
if: ${{ github.event.inputs.buildsys == 'ninja' && github.event.inputs.llpackage == 'true' }}
working-directory: ${{ env.FSBUILD_DIR }}
run: |
ninja llpackage
ninja -C ${FSBUILD_DIR} llpackage #dev
- name: Upload Artifact (ninja)
if: ${{ github.event.inputs.buildsys == 'ninja' && github.event.inputs.llpackage == 'true' }}
uses: actions/upload-artifact@v2
Expand All @@ -158,7 +164,7 @@ jobs:
shell: cmd
run: |
autobuild --version
autobuild configure -- --package --no-vstools --openal --chan ${{ env.VIEWER_CHANNEL }} -DLL_TESTS:BOOL=FALSE -DVS_DISABLE_FATAL_WARNINGS=ON
autobuild configure -- --package --no-vstools --openal --chan ${{ env.VIEWER_CHANNEL }} -DPYTHON_EXECUTABLE=${{ env.PYTHON_EXECUTABLE }} -DLL_TESTS:BOOL=FALSE -DVS_DISABLE_FATAL_WARNINGS=ON
- name: Build & Package (msbuild)
if: ${{ github.event.inputs.buildsys == 'msbuild' && github.event.inputs.llpackage == 'true' }}
shell: cmd
Expand Down

0 comments on commit b597937

Please sign in to comment.