diff --git a/.github/workflows/package-macos.yml b/.github/workflows/package-macos.yml new file mode 100644 index 000000000..387177247 --- /dev/null +++ b/.github/workflows/package-macos.yml @@ -0,0 +1,32 @@ +name: Package for macOS + +on: [push] + +jobs: + package: + + runs-on: macos-latest + + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Setup macOS build environment + run: | + ./scripts/package/macos-setup.sh + env: + DISCID_VERSION: 0.6.2 + FPCALC_VERSION: 1.4.3 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + source bin/activate + pip install -r requirements-macos.txt + - name: Build macOS app + run: | + source bin/activate + ./scripts/package/macos-package-app.sh + env: + UPLOAD_OSX: 1 diff --git a/scripts/package/macos-setup.sh b/scripts/package/macos-setup.sh index 5c6f72a0a..82e201942 100755 --- a/scripts/package/macos-setup.sh +++ b/scripts/package/macos-setup.sh @@ -7,9 +7,11 @@ brew install gettext brew link gettext --force # Install requested Python version -wget "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-macosx10.9.pkg" -sudo installer -pkg python-${PYTHON_VERSION}-macosx10.9.pkg -target / -sudo python3 -m ensurepip +if [ -n "$PYTHON_VERSION" ]; then + wget "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-macosx10.9.pkg" + sudo installer -pkg python-${PYTHON_VERSION}-macosx10.9.pkg -target / + sudo python3 -m ensurepip +fi # Install libdiscid wget "ftp://ftp.musicbrainz.org/pub/musicbrainz/libdiscid/libdiscid-$DISCID_VERSION.tar.gz"