diff --git a/source/_extra/release-latest.json b/source/_extra/release-latest.json index 8764ba3..7989dba 100644 --- a/source/_extra/release-latest.json +++ b/source/_extra/release-latest.json @@ -12,7 +12,8 @@ "appimage": "https://github.com/vkbo/novelWriter/releases/download/v2.4/novelWriter-2.4.AppImage", "debian": "https://github.com/vkbo/novelWriter/releases/download/v2.4/novelwriter_2.4_all.deb", "winexe": "https://github.com/vkbo/novelWriter/releases/download/v2.4/novelwriter-2.4-amd64-setup.exe", - "macdmg": "https://github.com/vkbo/novelWriter/releases/download/v2.4/novelWriter-2.4-amd64.dmg", + "macx86": "https://github.com/vkbo/novelWriter/releases/download/v2.4/novelWriter-2.4-x86_64.dmg", + "macarm": "https://github.com/vkbo/novelWriter/releases/download/v2.4/novelWriter-2.4-aarch64.dmg", "zipball": "https://api.github.com/repos/vkbo/novelWriter/zipball/v2.4", "tarball": "https://api.github.com/repos/vkbo/novelWriter/tarball/v2.4" } diff --git a/source/generated/checksum_block.rst b/source/generated/checksum_block.rst index ca59fe2..5de740c 100644 --- a/source/generated/checksum_block.rst +++ b/source/generated/checksum_block.rst @@ -7,8 +7,10 @@ Sha256 Checksums | Sha256: ``a0f343d1494e5d60edcb741e79b0617f9cdb0e195beef10629f04c4cb0667b5f`` :octicon:`download` `ShaSum File `__ * | **Windows Installer:** novelwriter-2.4-amd64-setup.exe | Sha256: ``1589127a67acf41b242338250b7949a08f7510470d430425d96f45968a238068`` :octicon:`download` `ShaSum File `__ -* | **MacOS DMG Image:** novelWriter-2.4-amd64.dmg - | Sha256: ``112a43f8614be36b2a59c1ab4d77dee6621603b72c5376dc18bb6ccba8104f94`` :octicon:`download` `ShaSum File `__ +* | **MacOS DMG Image (Intel):** novelWriter-2.4-x86_64.dmg + | Sha256: ``112a43f8614be36b2a59c1ab4d77dee6621603b72c5376dc18bb6ccba8104f94`` :octicon:`download` `ShaSum File `__ +* | **MacOS DMG Image (M1):** novelWriter-2.4-aarch64.dmg + | Sha256: ``0099661ede689bc51efca48c9fe5787d68d752ccb7326b306de58486ebbce5e4`` :octicon:`download` `ShaSum File `__ .. rubric:: Verify the Checksum @@ -40,4 +42,4 @@ Sha256 Checksums .. code-block:: bash - shasum -c novelWriter-2.4-amd64.dmg.sha256 + shasum -c novelWriter-2.4-x86_64.dmg.sha256 diff --git a/source/generated/download_block.rst b/source/generated/download_block.rst index 241f88f..14239f7 100644 --- a/source/generated/download_block.rst +++ b/source/generated/download_block.rst @@ -70,7 +70,8 @@ Latest Release :columns: 7 | **Download** - | :octicon:`download` `DMG Image `__ + | :octicon:`download` `DMG Image (Intel) `__ + | :octicon:`download` `DMG Image (M1) `__ | :octicon:`light-bulb` :ref:`Install Help ` .. grid-item:: diff --git a/source/generated/download_release.rst b/source/generated/download_release.rst index b903879..b0724c0 100644 --- a/source/generated/download_release.rst +++ b/source/generated/download_release.rst @@ -44,11 +44,18 @@ Windows MacOS ----- -**DMG Image** - This is a DMG image for MacOS, and should work on at least MacOS 12 or higher. +**DMG Image for Intel** + This is a DMG image for MacOS with x86_64 architecture. It is built on MacOS 12. - | **Download:** :octicon:`download` `novelWriter-2.4-amd64.dmg `__ [ 93.7 MB ] - | **Checksum:** :octicon:`hash` ``112a43f8614be36b2a59c1ab4d77dee6621603b72c5376dc18bb6ccba8104f94`` :octicon:`download` `ShaSum File `__ + | **Download:** :octicon:`download` `novelWriter-2.4-x86_64.dmg `__ [ 93.7 MB ] + | **Checksum:** :octicon:`hash` ``112a43f8614be36b2a59c1ab4d77dee6621603b72c5376dc18bb6ccba8104f94`` :octicon:`download` `ShaSum File `__ + + +**DMG Image for Apple Silicon (M1)** + This is a DMG image for MacOS with aarch64 architecture. It is built on MacOS 14. + + | **Download:** :octicon:`download` `novelWriter-2.4-aarch64.dmg `__ [ 71.5 MB ] + | **Checksum:** :octicon:`hash` ``0099661ede689bc51efca48c9fe5787d68d752ccb7326b306de58486ebbce5e4`` :octicon:`download` `ShaSum File `__ Other Packages diff --git a/templates/checksum_block.rst b/templates/checksum_block.rst index 9c08284..9b996a0 100644 --- a/templates/checksum_block.rst +++ b/templates/checksum_block.rst @@ -7,8 +7,10 @@ Sha256 Checksums | Sha256: ``{debian_shasum}`` :octicon:`download` `ShaSum File <{debian_shasumfile}>`__ * | **Windows Installer:** {winexe_name} | Sha256: ``{winexe_shasum}`` :octicon:`download` `ShaSum File <{winexe_shasumfile}>`__ -* | **MacOS DMG Image:** {macdmg_name} - | Sha256: ``{macdmg_shasum}`` :octicon:`download` `ShaSum File <{macdmg_shasumfile}>`__ +* | **MacOS DMG Image (Intel):** {macx86_name} + | Sha256: ``{macx86_shasum}`` :octicon:`download` `ShaSum File <{macx86_shasumfile}>`__ +* | **MacOS DMG Image (M1):** {macarm_name} + | Sha256: ``{macarm_shasum}`` :octicon:`download` `ShaSum File <{macarm_shasumfile}>`__ .. rubric:: Verify the Checksum @@ -40,4 +42,4 @@ Sha256 Checksums .. code-block:: bash - shasum -c {macdmg_name}.sha256 + shasum -c {macx86_name}.sha256 diff --git a/templates/download_block.rst b/templates/download_block.rst index cc53a66..96e4fdd 100644 --- a/templates/download_block.rst +++ b/templates/download_block.rst @@ -70,7 +70,8 @@ Latest Release :columns: 7 | **Download** - | :octicon:`download` `DMG Image <{macdmg_download}>`__ + | :octicon:`download` `DMG Image (Intel) <{macx86_download}>`__ + | :octicon:`download` `DMG Image (M1) <{macarm_download}>`__ | :octicon:`light-bulb` :ref:`Install Help ` .. grid-item:: diff --git a/tools/assets.py b/tools/assets.py index 142a497..c6b0620 100644 --- a/tools/assets.py +++ b/tools/assets.py @@ -17,8 +17,9 @@ class AssetType(Enum): APP_IMAGE_OLD = 2 DEBIAN = 3 WINDOWS_EXE = 4 - MAC_DMG = 5 - PYTHON_WHEEL = 6 + MAC_DMG_INTEL = 5 + MAC_DMG_ARM = 6 + PYTHON_WHEEL = 7 # END Enum AssetType @@ -51,9 +52,13 @@ class AssetOS(Enum): "Setup Installer", "This is a standard setup installer for Windows. It is made for Windows 10 or newer." ), - AssetType.MAC_DMG: ( - "DMG Image", - "This is a DMG image for MacOS, and should work on at least MacOS 12 or higher." + AssetType.MAC_DMG_INTEL: ( + "DMG Image for Intel", + "This is a DMG image for MacOS with x86_64 architecture. It is built on MacOS 12." + ), + AssetType.MAC_DMG_ARM: ( + "DMG Image for Apple Silicon (M1)", + "This is a DMG image for MacOS with aarch64 architecture. It is built on MacOS 14." ), AssetType.PYTHON_WHEEL: ( "Python Wheel", @@ -143,8 +148,11 @@ def _processAsset(self): elif name.endswith("setup.exe"): self._type = AssetType.WINDOWS_EXE self._os = AssetOS.WINDOWS - elif name.endswith(".dmg"): - self._type = AssetType.MAC_DMG + elif name.endswith(".dmg") and "x86_64" in name: + self._type = AssetType.MAC_DMG_INTEL + self._os = AssetOS.MACOS + elif name.endswith(".dmg") and "aarch64" in name: + self._type = AssetType.MAC_DMG_ARM self._os = AssetOS.MACOS elif name.endswith(".whl"): self._type = AssetType.PYTHON_WHEEL @@ -184,12 +192,13 @@ class DownloadAssets: def __init__(self, data): self._raw = data - self._assets = { + self._assets: dict[AssetType, Asset | None] = { AssetType.APP_IMAGE: None, AssetType.APP_IMAGE_OLD: None, AssetType.DEBIAN: None, AssetType.WINDOWS_EXE: None, - AssetType.MAC_DMG: None, + AssetType.MAC_DMG_INTEL: None, + AssetType.MAC_DMG_ARM: None, AssetType.PYTHON_WHEEL: None, } for asset in data.get("assets", []): @@ -240,7 +249,9 @@ def appendType(aType, target): buffer.append("MacOS") buffer.append("-----") buffer.append("") - appendType(AssetType.MAC_DMG, buffer) + appendType(AssetType.MAC_DMG_INTEL, buffer) + buffer.append("") + appendType(AssetType.MAC_DMG_ARM, buffer) buffer.append("") buffer.append("Other Packages") buffer.append("--------------") diff --git a/update.py b/update.py index 6c3b14c..2490b7f 100755 --- a/update.py +++ b/update.py @@ -42,7 +42,7 @@ def updateSetting(name: str, value: str) -> None: return -def writeReleaseInfo(version: str, force: bool, info: dict[str, str]) -> None: +def writeReleaseInfo(version: str, force: bool, info: dict[str, str | dict[str, str]]) -> None: """Write the release info file.""" relFile = Path("source/_extra/release-latest.json") current = json.loads(relFile.read_text(encoding="utf-8")) if relFile.exists() else {} @@ -195,7 +195,8 @@ def pullRelease(args): aAppImg = assets.getAsset(AssetType.APP_IMAGE) aDebian = assets.getAsset(AssetType.DEBIAN) aWinExe = assets.getAsset(AssetType.WINDOWS_EXE) - aMacDmg = assets.getAsset(AssetType.MAC_DMG) + aMacAMD = assets.getAsset(AssetType.MAC_DMG_INTEL) + aMacARM = assets.getAsset(AssetType.MAC_DMG_ARM) if isPreRelease: # Updating Pre-Release Info @@ -220,7 +221,8 @@ def pullRelease(args): "appimage": aAppImg.assetUrl, "debian": aDebian.assetUrl, "winexe": aWinExe.assetUrl, - "macdmg": aMacDmg.assetUrl, + "macx86": aMacAMD.assetUrl, + "macarm": aMacARM.assetUrl, "zipball": zipBall, "tarball": tarBall, } @@ -234,7 +236,8 @@ def pullRelease(args): "appimage_download": aAppImg.assetUrl, "debian_download": aDebian.assetUrl, "winexe_download": aWinExe.assetUrl, - "macdmg_download": aMacDmg.assetUrl, + "macx86_download": aMacAMD.assetUrl, + "macarm_download": aMacARM.assetUrl, }) buildFromTemplate("checksum_block.rst", "checksum_block.rst", { @@ -247,9 +250,12 @@ def pullRelease(args): "winexe_name": aWinExe.assetName, "winexe_shasum": aWinExe.assetShaSum, "winexe_shasumfile": aWinExe.assetShaSumUrl, - "macdmg_name": aMacDmg.assetName, - "macdmg_shasum": aMacDmg.assetShaSum, - "macdmg_shasumfile": aMacDmg.assetShaSumUrl, + "macx86_name": aMacAMD.assetName, + "macx86_shasum": aMacAMD.assetShaSum, + "macx86_shasumfile": aMacAMD.assetShaSumUrl, + "macarm_name": aMacARM.assetName, + "macarm_shasum": aMacARM.assetShaSum, + "macarm_shasumfile": aMacARM.assetShaSumUrl, }) buildFromTemplate("download_release.rst", "download_release.rst", {