Skip to content

Commit

Permalink
* Add arm64 to matrix
Browse files Browse the repository at this point in the history
* Update Python to 3.10.11 (arm64 builds not available for Python 3.9 from setup-python)
* Update DMG name to include Spyder version and architecture
  • Loading branch information
mrclary committed Feb 4, 2024
1 parent b4c4e1a commit f353bcc
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 15 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/installer-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ jobs:
echo "build_type=[${build_type}]" >> $GITHUB_OUTPUT
build:
name: macOS App Bundle
runs-on: macos-11
runs-on: ${{ matrix.os }}
needs: matrix_prep
strategy:
matrix:
build_type: ${{fromJson(needs.matrix_prep.outputs.build_type)}}
os: ["macos-11", "macos-14"]
defaults:
run:
shell: bash -l {0}
Expand All @@ -65,14 +66,13 @@ jobs:
APPLICATION_PWD: ${{ secrets.APPLICATION_PWD }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9.14'
architecture: 'x64'
python-version: '3.10.11'
- name: Install pcregrep
run: |
if [[ -z "$(which pcregrep)" ]]; then
Expand Down Expand Up @@ -115,15 +115,18 @@ jobs:
- name: Test Application Bundle
run: ./test_app.sh -t 60 -d 10 ${DISTDIR}
- name: Build Disk Image
run: ${pythonLocation}/bin/python setup.py ${LITE_FLAG} --dist-dir ${DISTDIR} --dmg --no-app
run: |
DMGNAME=$(${pythonLocation}/bin/python setup.py ${LITE_FLAG} --dmg-name)
${pythonLocation}/bin/python setup.py ${LITE_FLAG} --dist-dir ${DISTDIR} --dmg --no-app)
echo "DMGNAME=$DMGNAME" >> $GITHUB_ENV
- name: Sign Disk Image
if: ${{env.IS_RELEASE == 'true' || env.IS_PRE == 'true'}}
run: ./codesign.sh "${DISTDIR}/${DMGNAME}"
- name: Notarize Disk Image
if: ${{env.IS_RELEASE == 'true' || env.IS_PRE == 'true'}}
run: ./notarize.sh -i 30 -p "${APPLICATION_PWD}" "${DISTDIR}/${DMGNAME}"
- name: Upload Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
path: ${{ env.DISTDIR }}/${{ env.DMGNAME }}
name: ${{ env.DMGNAME }}
Expand All @@ -132,7 +135,7 @@ jobs:
id: get_release
env:
GITHUB_TOKEN: ${{ github.token }}
uses: bruceadams/get-release@v1.2.0
uses: bruceadams/get-release@v1.3.2
- name: Upload Release Asset
if: ${{env.IS_RELEASE == 'true'}}
uses: actions/upload-release-asset@v1
Expand Down
29 changes: 23 additions & 6 deletions installers/macOS/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from logging import getLogger, StreamHandler, Formatter
from pathlib import Path
from setuptools import setup
from platform import machine

from spyder import get_versions

Expand Down Expand Up @@ -98,6 +99,19 @@ def make_app_bundle(dist_dir, make_lite=False):
return


def disk_image_name(make_lite=False):
"""
Return disk image name
"""
dmg_name = f'Spyder-{SPYVER}_{machine()}'
if make_lite:
volume_name += ' Lite'
dmg_name += '-Lite'
dmg_name += '.dmg'

return dmg_name


def make_disk_image(dist_dir, make_lite=False):
"""
Make macOS disk image containing Spyder.app application bundle.
Expand All @@ -117,12 +131,7 @@ def make_disk_image(dist_dir, make_lite=False):
from dmgbuild.core import DMGError

volume_name = '{}-{} Py-{}.{}.{}'.format(APP_BASE_NAME, SPYVER, *PYVER)
dmg_name = 'Spyder'
if make_lite:
volume_name += ' Lite'
dmg_name += '-Lite'
dmg_name += '.dmg'
dmgfile = (dist_dir / dmg_name).as_posix()
dmgfile = (dist_dir / disk_image_name(make_lite)).as_posix()

settings_file = (THISDIR / 'dmg_settings.py').as_posix()
settings = {
Expand Down Expand Up @@ -162,9 +171,17 @@ def make_disk_image(dist_dir, make_lite=False):
parser.add_argument('-b', '--bdist-base', dest='build_dir',
default='build',
help='Build directory; passed to py2app')
parser.add_argument(
'-m', '--dmg-name', dest'dmg_name', action='store_true',
help='Return the DMG name: Spyder-{VER}_{ARCH}-{LITE}.dmg'
)

args, rem = parser.parse_known_args()

if args.dmg_name:
print(disk_image_name(args.make_lite))
sys.exit()

# Groom sys.argv for py2app
sys.argv = sys.argv[:1] + ['py2app'] + rem

Expand Down
2 changes: 1 addition & 1 deletion spyder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
OTHER DEALINGS IN THE SOFTWARE.
"""

version_info = (5, 5, 0)
version_info = (5, 5, 0, "post1")

__version__ = '.'.join(map(str, version_info))
__installer_version__ = __version__
Expand Down

0 comments on commit f353bcc

Please sign in to comment.