Skip to content

Commit

Permalink
create dmg
Browse files Browse the repository at this point in the history
  • Loading branch information
mirzakhany committed Jul 17, 2024
1 parent 5e3515d commit 39c7de9
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 6 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/build_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ jobs:
- name: Install gogio tool
run: go install gioui.org/cmd/gogio@latest

- name: Build macos amd64
run: make build_macos
- name: Install create-dmg tool
run: brew install create-dmg

- name: Build macos disk images
run: make build_macos_dmg

- name: Upload Release Asset
run: |
gh release upload ${{github.event.release.tag_name}} ./dist/Chapar_macos_amd64.tar.xz
gh release upload ${{github.event.release.tag_name}} ./dist/Chapar_macos_arm64.tar.xz
gh release upload ${{github.event.release.tag_name}} ./dist/chapar-${{ github.ref_name }}-amd64.dmg
gh release upload ${{github.event.release.tag_name}} ./dist/chapar-${{ github.ref_name }}-arm64.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
43 changes: 41 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,54 @@
.PHONY: build_macos
build_macos:
TAG_NAME?=$(shell git describe --tags)
APP_NAME="Chapar"

.PHONY: build_macos_app
build_macos_app:
@echo "Building Macos..."
gogio -icon=./build/appicon.png -target=macos -arch=amd64 -o ./dist/amd64/Chapar.app .
gogio -icon=./build/appicon.png -target=macos -arch=arm64 -o ./dist/arm64/Chapar.app .
codesign --force --deep --sign - ./dist/amd64/Chapar.app
codesign --force --deep --sign - ./dist/arm64/Chapar.app

.PHONY: build_macos
build_macos: build_macos_app
@echo "Building Macos..."
tar -cJf ./dist/Chapar_macos_amd64.tar.xz --directory=./dist/amd64 Chapar.app
tar -cJf ./dist/Chapar_macos_arm64.tar.xz --directory=./dist/arm64 Chapar.app
rm -rf ./dist/amd64
rm -rf ./dist/arm64

.PHONY: build_macos_dmg
build_macos_dmg: build_macos_app
@echo "Building Macos DMG..."
rm -rf ./dist/chapar-$(TAG_NAME)-amd64.dmg
rm -rf ./dist/chapar-$(TAG_NAME)-arm64.dmg
create-dmg \
--volname "Chapar Installer" \
--volicon "./build/appicon.icns" \
--background "./build/chapar-installer-bk.png" \
--window-pos 300 300 \
--window-size 500 350 \
--icon-size 100 \
--icon "Chapar.app" 125 150 \
--hide-extension "Chapar.app" \
--app-drop-link 375 150 \
"./dist/chapar-$(TAG_NAME)-arm64.dmg" \
"./dist/arm64/Chapar.app"

create-dmg \
--volname "Chapar Installer" \
--volicon "./build/appicon.icns" \
--background "./build/chapar-installer-bk.png" \
--window-pos 300 300 \
--window-size 500 350 \
--icon-size 100 \
--icon "Chapar.app" 125 150 \
--hide-extension "Chapar.app" \
--app-drop-link 375 150 \
"./dist/chapar-$(TAG_NAME)-amd64.dmg" \
"./dist/amd64/Chapar.app"


.PHONY: build_windows
build_windows:
@echo "Building Windows..."
Expand Down
Binary file added build/appicon.icns
Binary file not shown.
Binary file added build/chapar-installer-bk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 39c7de9

Please sign in to comment.