-
Notifications
You must be signed in to change notification settings - Fork 23
74 lines (69 loc) · 2.84 KB
/
build-environment-build.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
name: Build
on: [pull_request, push]
jobs:
build-mac:
name: macOS
runs-on: macos-10.15
env:
DEPENDENCY_CACHE: /Users/runner/dependencies
steps:
- name: checkout Git repository
uses: actions/checkout@v2
- name: dependency cache
uses: actions/cache@v2
env:
cache-name: dependencies
with:
path: ${{ env.DEPENDENCY_CACHE }}
key: ${{ env.cache-name }}-${{ runner.os}}-${{ hashFiles('download_dependencies.sh') }}
restore-keys: |
${{ env.cache-name }}-${{ runner.os }}
- name: ccache
uses: actions/cache@v2
env:
cache-name: ccache
with:
path: /Users/runner/Library/Caches/ccache
key: ${{ env.cache-name }}-${{ runner.os }}-${{ github.head_ref }}-${{ github.run_number }}
restore-keys: |
${{ env.cache-name }}-${{ runner.os }}-${{ github.head_ref }}
${{ env.cache-name }}-${{ runner.os }}
- name: build
env:
# 10.12 is the minimum macOS version for Qt 5.12
MACOSX_DEPLOYMENT_TARGET: 10.12
BRANCH_NAME: 2.3
ARCHITECTURE: x86_64
run: |
# Quit on errors.
# See also:
# - http://mywiki.wooledge.org/BashFAQ/105
# - https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
set -e -o pipefail
# Local echo.
set -x
# remove last number (patch number) from version number because Qt's configure script doesn't work with it
if [[ $(xcrun --show-sdk-version) =~ ([0-9]*\.[0-9]*)(.[0-9]*)? ]]; then
export MACOSX_SDK=${BASH_REMATCH[1]}
else
echo "macOS SDK version did not match expected format"
exit
fi
SHA=`git rev-parse --short HEAD`
ENVIRONMENT_NAME=${BRANCH_NAME}-${SHA}-sdk${MACOSX_SDK}-macosminimum${MACOSX_DEPLOYMENT_TARGET}-${ARCHITECTURE}
mkdir -p environment/${ENVIRONMENT_NAME}
scripts/macosx/download_dependencies.sh ${DEPENDENCY_CACHE}
scripts/macosx/build_environment.sh --macosx-sdk ${MACOSX_SDK} --dependency-cache ${DEPENDENCY_CACHE} --name ${ENVIRONMENT_NAME} --macosx-stdlib libc++ --enable-x86-64 2>&1 | tee environment/${ENVIRONMENT_NAME}/build_environment.log
tar -C environment -czf ${ENVIRONMENT_NAME}.tar.gz ${ENVIRONMENT_NAME}
- name: "upload macOS build environment as GitHub Actions artifact"
uses: actions/upload-artifact@v2
with:
name: macOS-build-environment
path: ./*.tar.gz
- name: "upload build environment to downloads.mixxx.org"
if: env.DOWNLOADS_HOSTGATOR_DOT_MIXXX_DOT_ORG_KEY_PASSWORD != null
run: ./deploy.sh
env:
FILE_TO_DEPLOY: ./*.tar.gz
DOWNLOADS_HOSTGATOR_DOT_MIXXX_DOT_ORG_KEY_PASSWORD: ${{ secrets.DOWNLOADS_HOSTGATOR_DOT_MIXXX_DOT_ORG_KEY_PASSWORD }}
SSH_KEY: downloads-hostgator.mixxx.org.key