Skip to content

Commit

Permalink
build: add create dmg script
Browse files Browse the repository at this point in the history
  • Loading branch information
u8slvn committed Aug 27, 2024
1 parent 47a43ce commit 64525c7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 18 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.12"]
os: [ Ubuntu, macOS, Windows ]
os: [ Ubuntu, macOS-x86_64, macOS-arm64, Windows ]
include:
- os: Ubuntu
image: ubuntu-22.04
image: ubuntu-latest
- os: Windows
image: windows-2022
- os: macOS x86_64
image: windows-latest
- os: macOS-x86_64
image: macos-13
- os: macOS arm64
image: macos-14
- os: macOS-arm64
image: macos-latest
defaults:
run:
shell: bash
Expand Down
21 changes: 9 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: build
name: release
on:
push:
tags:
- "v*.*.*"
jobs:
release-windows:
name: build-${{ matrix.arch }}
runs-on: windows-latest
name: build-windows-${{ matrix.arch }}
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
# with:
# files: dist/doggo-*.exe

build-macos:
release-macos:
name: build-macos-${{ matrix.arch }}
runs-on: macos-${{ matrix.os-version }}
strategy:
Expand All @@ -66,10 +66,8 @@ jobs:
include:
- os-version: 13
arch: x86_64
arch-name: Intel
- os-version: 14
arch: aarch64
arch-name: AppleSilicon
defaults:
run:
shell: bash
Expand Down Expand Up @@ -97,14 +95,13 @@ jobs:
run: |
poetry run python scripts/build.py --os macos
- name: Sign app
run: codesign --force --deep -s - ./dist/doggo-*.app
# brew install create-dmg
# VERSION=$(grep -m 1 version pyproject.toml | grep -e '\d.\d.\d' -o)
# create-dmg --volname "Doggo" --no-internet-enable "doggo-$VERSION-${{ matrix.arch-name }}.dmg" "./dist/doggo-$VERSION-macos.app"
- name: Create DMG
run: |
brew install create-dmg
./scripts/create-dmg.sh
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: macos-${{ matrix.arch-name }}
path: ${{ github.workspace }}/dist/doggo-*.app
path: ${{ github.workspace }}/doggo-*.dmg
13 changes: 13 additions & 0 deletions scripts/create-dmg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

ARCH_NAME=$([[ "$(arch)" = "arm64" ]] && echo "AppleSilicon" || echo "Intel")
VERSION=$(poetry version --short)

mkdir ./dist/dmg
mv ./dist/doggo-*.app ./dist/dmg/Doggo.app

create-dmg \
--volname "Doggo" \
--hide-extension "Doggo.app" \
"doggo-$VERSION-$ARCH_NAME.dmg" \
"./dist/dmg/Doggo.app"

0 comments on commit 64525c7

Please sign in to comment.