Skip to content

Commit

Permalink
matrix build with lipo and update lock python version
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-courtney-pieces committed Sep 10, 2024
1 parent a71bae1 commit 8c4cd80
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 204 deletions.
99 changes: 49 additions & 50 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, macos-14-large]
os: [ macos-latest, macos-14-large ]
steps:
### Checking out our Repo
- uses: actions/checkout@v3

### Setting up python
- name: Set up Python 3.9
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: 3.11

### Getting the version from the git tag or the branch name if there is none
- name: Get the version
Expand All @@ -54,6 +54,24 @@ jobs:
run: echo "STAGING_VERSION=$(/bin/bash staging_versioning.sh)" >> $GITHUB_OUTPUT
if: inputs.deploy == false

### Install SSH
- uses: shimataro/ssh-key-action@v2
with:
key: "${{ secrets.ssh_private_key }}"
name: id_rsa
known_hosts: "github.com"
if_key_exists: fail

### Setting up our fastlane certificates
- name: Setup Certificates
run: |-
cd macos
bundle install
bundle exec fastlane setup
env:
MATCH_PASSWORD: ${{ secrets.match_password }}
FASTLANE_PASSWORD: ${{ secrets.fastlane_password }}

### Installing our dependencies
- name: Install dependencies
run: |
Expand All @@ -75,7 +93,7 @@ jobs:
export STAGING_VERSION='${{ steps.staging_version.outputs.STAGING_VERSION }}'
poetry version $STAGING_VERSION
fi
### Writing our staging version to a file to be pulled in the last step to update our json in the cloud
- name: Write staging version to file
shell: bash
Expand All @@ -89,30 +107,12 @@ jobs:
### Building Standalone Package
- name: Build stand alone
run: |
poetry run pyinstaller -c --onefile src/pieces/app.py --hidden-import=pydantic_core --name=pieces_${{ matrix.os }}
poetry run pyinstaller -c --onefile src/pieces/app.py --hidden-import=pydantic_core --name=pieces_${{ matrix.os }} --codesign-identity="Developer ID Application: Mesh Intelligent Technologies, Inc. (287L9TU9JL)"
### Install SSH
- uses: shimataro/ssh-key-action@v2
with:
key: "${{ secrets.ssh_private_key }}"
name: id_rsa
known_hosts: "github.com"
if_key_exists: fail

### Setting up our fastlane certificates
- name: Setup Certificates
run: |-
cd macos
bundle install
bundle exec fastlane setup
env:
MATCH_PASSWORD: ${{ secrets.match_password }}
FASTLANE_PASSWORD: ${{ secrets.fastlane_password }}

### Codesign Binary Macos
- name: Codesign Binary Macos
run: |
codesign -s "Developer ID Application: Mesh Intelligent Technologies, Inc. (287L9TU9JL)" -i com.pieces.cli -o runtime --entitlements macos/Release.entitlements --timestamp -f dist/pieces_${{ matrix.os }}
# ### Codesign Binary Macos
# - name: Codesign Binary Macos
# run: |
# codesign -s "Developer ID Application: Mesh Intelligent Technologies, Inc. (287L9TU9JL)" -i com.pieces.cli -o runtime --entitlements macos/Release.entitlements --timestamp -f dist/pieces_${{ matrix.os }}

### Upload build artifact for combining later
- uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -153,33 +153,32 @@ jobs:
run: |
mkdir dist
cp *.tar.gz *.whl ./dist/
cp pieces_macos-14-large pieces_macos-latest ./dist/
lipo -create -output dist/pieces pieces_macos-latest pieces_macos-14-large
chmod 777 dist/pieces
file dist/pieces
### Install SSH
- uses: shimataro/ssh-key-action@v2
with:
key: "${{ secrets.ssh_private_key }}"
name: id_rsa
known_hosts: "github.com"
if_key_exists: fail

### Setting up our fastlane certificates
- name: Setup Certificates
run: |-
cd macos
bundle install
bundle exec fastlane setup
env:
MATCH_PASSWORD: ${{ secrets.match_password }}
FASTLANE_PASSWORD: ${{ secrets.fastlane_password }}

### Codesign the universal binary
- name: Codesign Universal Binary
run: |
codesign -s "Developer ID Application: Mesh Intelligent Technologies, Inc. (287L9TU9JL)" -i com.pieces.cli -o runtime --entitlements macos/Release.entitlements --timestamp -f dist/pieces
# ### Install SSH
# - uses: shimataro/ssh-key-action@v2
# with:
# key: "${{ secrets.ssh_private_key }}"
# name: id_rsa
# known_hosts: "github.com"
# if_key_exists: fail
#
# ### Setting up our fastlane certificates
# - name: Setup Certificates
# run: |-
# cd macos
# bundle install
# bundle exec fastlane setup
# env:
# MATCH_PASSWORD: ${{ secrets.match_password }}
# FASTLANE_PASSWORD: ${{ secrets.fastlane_password }}
#
# ### Codesign the universal binary
# - name: Codesign Universal Binary
# run: |
# codesign -s "Developer ID Application: Mesh Intelligent Technologies, Inc. (287L9TU9JL)" -i com.pieces.cli -o runtime --entitlements macos/Release.entitlements --timestamp -f dist/pieces

### Getting the version from the git tag or the branch name if there is none
- name: Get the version
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,4 @@ cython_debug/
.idea/

cli-agent.iml
macos/notes.txt
Loading

0 comments on commit 8c4cd80

Please sign in to comment.