ci: simplify macport build (#1586)
This commit is contained in:
parent
f1452d25ad
commit
e7b112a2a6
2 changed files with 22 additions and 93 deletions
113
.github/workflows/CI.yml
vendored
113
.github/workflows/CI.yml
vendored
|
|
@ -634,104 +634,33 @@ jobs:
|
||||||
echo "/opt/local/bin" >> $GITHUB_PATH
|
echo "/opt/local/bin" >> $GITHUB_PATH
|
||||||
echo "/opt/local/sbin" >> $GITHUB_PATH
|
echo "/opt/local/sbin" >> $GITHUB_PATH
|
||||||
|
|
||||||
- name: Determine list of subports
|
- name: Run port lint
|
||||||
id: subportlist
|
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
port -q lint "Sunshine"
|
||||||
port=Sunshine
|
|
||||||
subportlist=""
|
|
||||||
|
|
||||||
echo "Listing subports for Sunshine"
|
- name: Build port
|
||||||
new_subports=$(mpbb \
|
|
||||||
--work-dir /tmp/mpbb \
|
|
||||||
list-subports \
|
|
||||||
--archive-site= \
|
|
||||||
--archive-site-private= \
|
|
||||||
--include-deps=no \
|
|
||||||
"$port" \
|
|
||||||
| tr '\n' ' ')
|
|
||||||
for subport in $new_subports; do
|
|
||||||
echo "$subport"
|
|
||||||
subportlist="$subportlist $subport"
|
|
||||||
done
|
|
||||||
echo "subportlist=${subportlist}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Run port lint for all subports
|
|
||||||
env:
|
env:
|
||||||
subportlist: ${{ steps.subportlist.outputs.subportlist }}
|
subportlist: ${{ steps.subportlist.outputs.subportlist }}
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
subport="Sunshine"
|
||||||
fail=0
|
|
||||||
for subport in $subportlist; do
|
|
||||||
echo "::group::${subport}"
|
|
||||||
path=$(port file "$subport")
|
|
||||||
messagetype="warning"
|
|
||||||
if ! messages=$(port -q lint "$subport" 2>&1); then
|
|
||||||
messagetype="error"
|
|
||||||
fail=1
|
|
||||||
fi
|
|
||||||
if [ -n "$messages" ]; then
|
|
||||||
echo "$messages"
|
|
||||||
# See https://github.com/actions/toolkit/issues/193#issuecomment-605394935
|
|
||||||
encoded_messages="port lint ${subport}:%0A"
|
|
||||||
encoded_messages+="$(echo "${messages}" | sed -E 's/$/%0A/g' | tr -d '\n')"
|
|
||||||
echo "::${messagetype} file=${path#${PWD}/ports/},line=1,col=1::${encoded_messages}"
|
|
||||||
fi
|
|
||||||
echo "::endgroup::"
|
|
||||||
done
|
|
||||||
exit "$fail"
|
|
||||||
|
|
||||||
- name: Build subports
|
workdir="/tmp/mpbb/$subport"
|
||||||
env:
|
mkdir -p "$workdir/logs"
|
||||||
subportlist: ${{ steps.subportlist.outputs.subportlist }}
|
|
||||||
run: |
|
echo "::group::Installing dependencies"
|
||||||
set -eu
|
sudo mpbb \
|
||||||
fail=0
|
--work-dir "$workdir" \
|
||||||
for subport in $subportlist; do
|
install-dependencies \
|
||||||
workdir="/tmp/mpbb/$subport"
|
"$subport"
|
||||||
mkdir -p "$workdir/logs"
|
echo "::endgroup::"
|
||||||
touch "$workdir/logs/dependencies-progress.txt"
|
|
||||||
echo "::group::Cleaning up between ports"
|
echo "::group::Installing ${subport}"
|
||||||
sudo mpbb --work-dir "$workdir" cleanup
|
sudo mpbb \
|
||||||
echo "::endgroup::"
|
--work-dir "$workdir" \
|
||||||
echo "::group::Installing dependencies for ${subport}"
|
install-port \
|
||||||
sudo mpbb \
|
--source \
|
||||||
--work-dir "$workdir" \
|
"$subport"
|
||||||
install-dependencies \
|
echo "::endgroup::"
|
||||||
"$subport" >"$workdir/logs/install-dependencies.log" 2>&1 &
|
|
||||||
deps_pid=$!
|
|
||||||
tail -f "$workdir/logs/dependencies-progress.txt" 2>/dev/null &
|
|
||||||
tail_pid=$!
|
|
||||||
set +e
|
|
||||||
wait "$deps_pid"
|
|
||||||
deps_exit=$?
|
|
||||||
set -e
|
|
||||||
kill "$tail_pid" || true
|
|
||||||
if [ "$deps_exit" -ne 0 ]; then
|
|
||||||
echo "::endgroup::"
|
|
||||||
echo "::error::Failed to install dependencies for ${subport}"
|
|
||||||
fail=1
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
echo "::endgroup::"
|
|
||||||
echo "::group::Installing ${subport}"
|
|
||||||
set +e
|
|
||||||
sudo mpbb \
|
|
||||||
--work-dir "$workdir" \
|
|
||||||
install-port \
|
|
||||||
--source \
|
|
||||||
"$subport"
|
|
||||||
install_exit=$?
|
|
||||||
set -e
|
|
||||||
if [ "$install_exit" -ne 0 ]; then
|
|
||||||
echo "::endgroup::"
|
|
||||||
echo "::error::Failed to install ${subport}"
|
|
||||||
fail=1
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
echo "::endgroup::"
|
|
||||||
done
|
|
||||||
exit "$fail"
|
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ depends_lib port:avahi \
|
||||||
port:npm9 \
|
port:npm9 \
|
||||||
port:pkgconfig
|
port:pkgconfig
|
||||||
|
|
||||||
boost.version 1.80
|
boost.version 1.81
|
||||||
|
|
||||||
configure.args -DCMAKE_INSTALL_PREFIX=${prefix} \
|
configure.args -DCMAKE_INSTALL_PREFIX=${prefix} \
|
||||||
-DSUNSHINE_ASSETS_DIR=etc/sunshine/assets
|
-DSUNSHINE_ASSETS_DIR=etc/sunshine/assets
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue