Skip to content

Commit 814fc76

Browse files
committed
Feat: Add support for macOS package types
This commit adds support for building macOS packages in multiple formats, including `.pkg` and `.dmg`. This allows for greater flexibility in distributing the application on macOS.
1 parent f075998 commit 814fc76

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ jobs:
5656
if: matrix.os == 'macos-latest'
5757
run: |
5858
brew update
59-
brew install openssl@3 rustup-init pkg-config llvm create-dmg
59+
brew install openssl@3 rustup-init pkg-config llvm
60+
xcode-select --install
6061
echo "OPENSSL_DIR=$(brew --prefix openssl@3)" >> $GITHUB_ENV
6162
echo "OPENSSL_LIB_DIR=$(brew --prefix openssl@3)/lib" >> $GITHUB_ENV
6263
echo "OPENSSL_INCLUDE_DIR=$(brew --prefix openssl@3)/include" >> $GITHUB_ENV
@@ -113,31 +114,22 @@ jobs:
113114
mv app/target/wix/*.msi artifacts/
114115
shell: bash
115116

116-
- name: Package macOS (.dmg)
117+
- name: Package macOS (.pkg)
117118
if: matrix.package_type == 'mac'
118119
run: |
119-
cd app
120-
cargo install cargo-bundle --force
121-
cargo bundle --release --target ${{ matrix.target }}
122-
cd ..
120+
mkdir -p ~/gitswift-installer/user/local/bin
121+
cp app/target/${{ matrix.target }}/release/gitswift ~/gitswift-installer/user/local/bin/
122+
pkgbuild --identifier com.singhropar.gitswift --version 1.0 --install-location/ --root ~/gitswift-installer artifacts/gitswift.pkg
123123
env:
124124
BUNDLE_ID: com.singhropar.gitswift
125125
BUNDLE_NAME: gitswift
126-
MACOSX_DEPLOYMENT_TARGET: 10.12
126+
MACOSX_DEPLOYMENT_TARGET: 11.0
127127
OPENSSL_DIR: ${{ env.OPENSSL_DIR }}
128128
OPENSSL_LIB_DIR: ${{ env.OPENSSL_LIB_DIR }}
129129
OPENSSL_INCLUDE_DIR: ${{ env.OPENSSL_INCLUDE_DIR }}
130130
CC: ${{ env.CC }}
131131
CXX: ${{ env.CXX }}
132132

133-
- name: Convert .app to .dmg
134-
if: matrix.package_type == 'mac'
135-
run: |
136-
mkdir -p dist
137-
create-dmg "app/target/aarch64-apple-darwin/release/bundle/osx/gitswift.app" "dist/"
138-
mkdir -p artifacts
139-
mv dist/*.dmg artifacts/
140-
141133

142134
- name: Upload Artifacts
143135
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)