Skip to content

Commit

Permalink
build m1 binary
Browse files Browse the repository at this point in the history
  • Loading branch information
sunderme committed Aug 14, 2024
1 parent 1286d1b commit c0fb239
Showing 1 changed file with 72 additions and 1 deletion.
73 changes: 72 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:

macosx:
name: Mac OS X
runs-on: macos-11
runs-on: macos-12
if: true

steps:
Expand Down Expand Up @@ -195,5 +195,76 @@ jobs:
files: build/dataexplorer-osx-${{ steps.package.outputs.VERSION_NAME }}.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }}

macosxM1:
name: Mac OS X (M1)
runs-on: macos-14
if: true

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Fetch tag annotations
run: git fetch --tags --force

- name: Install Dependencies
run: |
wget https://github.com/sunderme/homebrew-qt6-modules/releases/download/${{ env.OSX_QT_VERSION }}/QtBase-${{ env.OSX_QT_VERSION }}-Darwin-M1.tar.xz
sudo tar xvf ./QtBase-${{ env.OSX_QT_VERSION }}-Darwin-M1.tar.xz -C /usr/local
rm QtBase-${{ env.OSX_QT_VERSION }}-Darwin.tar.xz
wget https://github.com/sunderme/homebrew-qt6-modules/releases/download/${{ env.OSX_QT_VERSION }}/QtSvg-${{ env.OSX_QT_VERSION }}-Darwin-M1.tar.xz
sudo tar xvf ./QtSvg-${{ env.OSX_QT_VERSION }}-Darwin-M1.tar.xz -C /usr/local/QtBase-${{ env.OSX_QT_VERSION }}-Darwin --strip-components=1
rm QtSvg-${{ env.OSX_QT_VERSION }}-Darwin.tar.xz
wget https://github.com/sunderme/homebrew-qt6-modules/releases/download/${{ env.OSX_QT_VERSION }}/QtCharts-${{ env.OSX_QT_VERSION }}-Darwin-M1.tar.xz
sudo tar xvf ./QtCharts-${{ env.OSX_QT_VERSION }}-Darwin-M1.tar.xz -C /usr/local/QtBase-${{ env.OSX_QT_VERSION }}-Darwin --strip-components=1
rm QtCharts-${{ env.OSX_QT_VERSION }}-Darwin-M1.tar.xz
- name: Configure
run: |
mkdir build
cd build
/usr/local/QtBase-${{ env.OSX_QT_VERSION }}-Darwin/bin/qt-cmake ..
- name: Build
run: cmake --build build

- name: Workarounds
run: |
mkdir -p texstudio.app/Contents/Frameworks
cp /usr/local/lib/libbrotlicommon.1.dylib texstudio.app/Contents/Frameworks
- name: Package
id: package
run: |
cd build
# /usr/local/QtBase-${{ env.OSX_QT_VERSION }}-Darwin/bin/macdeployqt dataexplorer.app -dmg
/usr/local/QtBase-${{ env.OSX_QT_VERSION }}-Darwin/bin/macdeployqt dataexplorer.app
codesign --force --deep --sign - dataexplorer.app
. ../.github/scripts/get-version.sh
cp -r dataexplorer.app ../dataexplorer-${GIT_VERSION}-osx-m1.app
mkdir ../app
mv dataexplorer.app ../app/dataexplorer-osx-m1-${VERSION_NAME}.app
cd ..
zip -r dataexplorer-${GIT_VERSION}-osx-m1.zip dataexplorer-${GIT_VERSION}-osx-m1.app
echo "VERSION_NAME=${VERSION_NAME}" >> $GITHUB_OUTPUT
- name: Upload to Github artifacts
if: github.event_name == 'push'
uses: actions/upload-artifact@v3
with:
name: dataexplorer-osx-m1
path: app

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }}
files: app/dataexplorer-osx-m1-${{ steps.package.outputs.VERSION_NAME }}.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }}


0 comments on commit c0fb239

Please sign in to comment.