-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
107 lines (107 loc) · 3.69 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
---
name: "Install Packages vi Homebrew"
inputs:
ARCH:
required: true
type: string
CROSS_COMPILE:
required: true
type: boolean
PYVERS:
required: true
type: string
PYDOTVERS:
required: true
type: string
ANSIBLEVERS:
required: true
type: string
DBVERS:
required: true
type: string
QTVERS:
required: true
type: string
COMPILER:
required: true
type: string
runs:
using: "composite"
steps:
- name: "Remove formula for a fresh homebrew install"
id: nuke_brew
shell: bash
run: |
echo "Removing all previously install formula"
brew remove --cask --force $(brew list)
brew remove --force $(brew list --formula)
# check if we're cross-compiling, setting up the brew command appropriately
if $CROSS_COMPILE; then
PKGMGR_PATH=$(arch -${ARCH} brew --prefix)
PKGMGR_CMD="arch -${ARCH} $PKGMGR_PATH/bin/brew"
else
PKGMGR_PATH=$(brew --prefix)
PKGMGR_CMD="$PKGMGR_PATH/bin/brew"
fi
echo "PKGMGR_PATH=$PKGMGR_PATH" >> $GITHUB_ENV
echo "PKGMGR_CMD=$PKGMGR_CMD" >> $GITHUB_ENV
echo "Updating homebrew"
${PKGMGR_CMD} update
- name: "Install required support packages"
id: install_req_packages
shell: bash
env:
PYVERS: ${{ inputs.PYVERS }}
PYDOTVERS: ${{ inputs.PYDOTVERS }}
ANSIBLEVERS: ${{ inputs.ANSIBLEVERS }}
DBVERS: ${{ inputs.DBVERS }}
COMPILER: ${{ inputs.COMPILER }}
run: |
PKGMGR_BIN=$PKGMGR_PATH/bin
echo "PKGMGR_BIN=$PKGMGR_BIN" >> $GITHUB_ENV
export PATH=$PATH:$PKGMGR_BIN
echo "Install requested python"
${PKGMGR_CMD} install --force --overwrite python@${PYDOTVERS}
${PKGMGR_CMD} link --force python@${PYDOTVERS}
${PKGMGR_CMD} link --force python3
echo "Installing and correctly linking openssl"
${PKGMGR_CMD} install openssl@1.1
${PKGMGR_CMD} unlink openssl
${PKGMGR_CMD} unlink openssl@1.1
${PKGMGR_CMD} install openssl@3
${PKGMGR_CMD} link --force openssl
${PKGMGR_CMD} link --force openssl@3
echo "Installing ansible and $DBVERS"
${PKGMGR_CMD} install --force --overwrite ansible@$ANSIBLEVERS $DBVERS pkg-config
ANS_PB="${PKGMGR_PATH}/opt/ansible@${ANSIBLEVERS}/bin/ansible-playbook"
if $CROSS_COMPILE; then
ANS_PB="arch -${ARCH} $ANS_PB"
fi
echo "ANS_PB=$ANS_PB" >> $GITHUB_ENV
- name: "Install required packages via ansible"
id: ansible_install
shell: bash
env:
PYDOTVERS: ${{ inputs.PYDOTVERS }}
DBVERS: ${{ inputs.DBVERS }}
run: |
cd ansible
echo "Installing packages via ansible playbook"
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$PKGMGR_PATH/lib/pkgconfig/mysqlclient.pc
export MYSQLCLIENT_LDFLAGS=$(pkg-config --libs mysqlclient)
export MYSQLCLIENT_CFLAGS=$(pkg-config --cflags mysqlclient)
XTRA_VARS="ansible_python_interpreter=${PKGMGR_BIN}/python${PYDOTVERS} \
database_version=${DBVERS}"
echo "Running ansible"
export C_INCLUDE_PATH=$C_INCLUDE_PATH:$PKGMGR_PATH/include
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$PKGMGR_PATH/include
export LIBRARY_PATH=$LIBRARY_PATH:$PKGMGR_PATH/lib
${ANS_PB} mythtv.yml --extra-vars="$XTRA_VARS" --limit=localhost
- name: "Cleanup homebrew install"
id: homebrew_cleanup
shell: bash
run: |
echo "Cleaning up homebrew builds"
# force ownership for the users ansible / mythtv temp directories
sudo chown $(id -u):$(id -g) ~/.ansible
sudo chown $(id -u):$(id -g) ~/.mythtv