Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add macos native support #7

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
build:
name: Build and analyse using xcodebuild command
name: Build and Analyse Using xcodebuild Command
runs-on: macos-13

steps:
Expand All @@ -20,6 +20,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Build
- name: Build and Analyse Reveil
run: |
xcodebuild clean build analyze -scheme Reveil -project Reveil.xcodeproj CODE_SIGNING_ALLOWED=NO | xcpretty && exit ${PIPESTATUS[0]}
109 changes: 109 additions & 0 deletions .github/workflows/build-archive-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Xcode - Build Archive (macOS)

on:
push:
branches: [ "feat/macos-native-support" ]

env:
MARKETING_VERSION: 0.0.0
PATCH_VERSION: 0

jobs:
build:
name: Build Notarized macOS Application
runs-on: macos-13

steps:
- name: Install Packaging Tools
run: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install graphicsmagick imagemagick
npm install -g create-dmg

- name: Checkout
uses: actions/checkout@v3

- name: Configure Code-Signing Keychain
run: |
KETSTORE_PATH="$PWD/Certificates/Certificates.p12"
KEYCHAIN_PATH="$RUNNER_TEMP/app-signing.keychain-db"
security create-keychain -p "$KEYSTORE_PASSWORD" "$KEYCHAIN_PATH"
security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH"
security unlock-keychain -p "$KEYSTORE_PASSWORD" "$KEYCHAIN_PATH"
security import "$KETSTORE_PATH" -P "$KEYSTORE_PASSWORD" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH"
security list-keychain -d user -s "$KEYCHAIN_PATH"
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} # Password for the keychain & p12 keystore

- name: Setup Xcode Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 15.1

- name: Read Version Strings
run: |
git fetch --tags
export GIT_TAG=$(git describe --tags --always --abbrev=0)
export PATCH_VERSION=$(echo "${GIT_TAG#v}" | cut -d. -f3)
echo "PATCH_VERSION=${PATCH_VERSION}" >> $GITHUB_ENV
echo "MARKETING_VERSION=${GIT_TAG#v}" >> $GITHUB_ENV

- name: Build ReveilHelper
run: |
xcodebuild clean build archive -scheme ReveilHelper -project Reveil.xcodeproj -archivePath ReveilHelper.xcarchive CODE_SIGNING_ALLOWED=NO | xcpretty && exit ${PIPESTATUS[0]}

- name: Build Reveil (macOS)
run: |
PATH=$PWD/ReveilHelper.xcarchive/Products/usr/local/bin:$PATH xcodebuild clean build archive -scheme Reveil -project Reveil.xcodeproj -sdk macosx -destination 'generic/platform=macOS' -archivePath Reveil CODE_SIGN_STYLE='Manual' CODE_SIGN_IDENTITY='$CODE_SIGN_IDENTITY' | xcpretty && exit ${PIPESTATUS[0]}
env:
DEVELOPMENT_TEAM: ${{ secrets.DEVELOPMENT_TEAM }} # Team ID
CODE_SIGN_IDENTITY: ${{ secrets.CODE_SIGN_IDENTITY }} # Code-Signing Identity, e.g. "Apple Development: John Doe (XXXXXXXXXX)"

- name: Notarize Reveil
run: |
mkdir -p Distribution
echo "$APPSTORECONNECT_AUTHKEY" > "$PWD/AuthKey_$APPSTORECONNECT_AUTHKEY_ID.p8"
xcodebuild -exportArchive -allowProvisioningUpdates -authenticationKeyID $APPSTORECONNECT_AUTHKEY_ID -authenticationKeyIssuerID $APPSTORECONNECT_AUTHKEY_ISSUER_ID -authenticationKeyPath "$PWD/AuthKey_$APPSTORECONNECT_AUTHKEY_ID.p8" -archivePath Reveil.xcarchive -exportPath Distribution -exportOptionsPlist $PWD/ExportOptions.plist
env:
APPSTORECONNECT_AUTHKEY: ${{ secrets.APPSTORECONNECT_AUTHKEY }} # App Store Connect API Key, begin with "-----BEGIN PRIVATE KEY-----"
APPSTORECONNECT_AUTHKEY_ID: ${{ secrets.APPSTORECONNECT_AUTHKEY_ID }} # App Store Connect API Key ID
APPSTORECONNECT_AUTHKEY_ISSUER_ID: ${{ secrets.APPSTORECONNECT_AUTHKEY_ISSUER_ID }} # App Store Connect API Key Issuer ID

- name: Export Notarized Application
run: |
until xcodebuild -exportNotarizedApp -authenticationKeyID $APPSTORECONNECT_AUTHKEY_ID -authenticationKeyIssuerID $APPSTORECONNECT_AUTHKEY_ISSUER_ID -authenticationKeyPath "$PWD/AuthKey_$APPSTORECONNECT_AUTHKEY_ID.p8" -archivePath Reveil.xcarchive -exportPath Distribution;
do
echo "Waiting for notarization..."
sleep 10
done
env:
APPSTORECONNECT_AUTHKEY: ${{ secrets.APPSTORECONNECT_AUTHKEY }}
APPSTORECONNECT_AUTHKEY_ID: ${{ secrets.APPSTORECONNECT_AUTHKEY_ID }}
APPSTORECONNECT_AUTHKEY_ISSUER_ID: ${{ secrets.APPSTORECONNECT_AUTHKEY_ISSUER_ID }}

- name: Create DMG
run: |
create-dmg --overwrite --identity="$PACKAGING_IDENTITY" Distribution/Reveil.app ./Distribution/
mv Distribution/*.dmg Reveil_${{ env.MARKETING_VERSION }}.dmg
env:
PACKAGING_IDENTITY: ${{ secrets.PACKAGING_IDENTITY }} # Identity for packaging, e.g. "Developer ID Application: John Doe (XXXXXXXXXX)"

- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: Reveil_${{ env.MARKETING_VERSION }}
path: |
Reveil.xcarchive
ReveilHelper.xcarchive
Distribution/Reveil_${{ env.MARKETING_VERSION }}.dmg

# - name: Upload Release
# uses: softprops/action-gh-release@v1
# with:
# token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
# body_path: CHANGELOG.md
# files: Distribution/Reveil_${{ env.MARKETING_VERSION }}.dmg

- name: Remove Code-Signing Keychain
if: ${{ always() }}
run: |
security delete-keychain "$RUNNER_TEMP/app-signing.keychain-db"
29 changes: 16 additions & 13 deletions .github/workflows/build-archive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,33 @@ env:

jobs:
build:
name: Build sideloading package for TrollStore
name: Build Side-loading Package for TrollStore
runs-on: macos-13

steps:
- name: Setup Xcode version
- name: Setup Xcode Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 15.1

- name: Checkout
uses: actions/checkout@v3

- name: Update version strings
- name: Read Version Strings
run: |
export PATCH_VERSION=$(echo "${GITHUB_REF#refs/tags/v}" | cut -d. -f3)
echo "PATCH_VERSION=${PATCH_VERSION}" >> $GITHUB_ENV
echo "MARKETING_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
xcrun agvtool new-version -all "${PATCH_VERSION}"
xcrun agvtool new-marketing-version "${GITHUB_REF#refs/tags/v}"

- name: Build helper
- name: Build ReveilHelper
run: |
xcodebuild clean build archive -scheme ReveilHelper -project Reveil.xcodeproj -archivePath ReveilHelper.xcarchive CODE_SIGNING_ALLOWED=NO | xcpretty && exit ${PIPESTATUS[0]}

- name: Build
- name: Build Reveil
run: |
PATH=$PWD/ReveilHelper.xcarchive/Products/usr/local/bin:$PATH xcodebuild clean build archive -scheme Reveil -project Reveil.xcodeproj -sdk iphoneos -destination 'generic/platform=iOS' -archivePath Reveil CODE_SIGNING_ALLOWED=NO | xcpretty && exit ${PIPESTATUS[0]}

- name: Package for sideloading
- name: Package for Side-loading
run: |
cd Reveil.xcarchive/Products/Applications
codesign --remove-signature Reveil.app
Expand All @@ -48,17 +46,22 @@ jobs:
mv Applications Payload
zip -qr Reveil_${{ env.MARKETING_VERSION }}.tipa Payload
cd -
mv Reveil.xcarchive/Products/Reveil_${{ env.MARKETING_VERSION }}.tipa .
mkdir -p Distribution
mv Reveil.xcarchive/Products/Reveil_${{ env.MARKETING_VERSION }}.tipa ./Distribution/

- name: Upload artifact
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: Reveil_${{ env.MARKETING_VERSION }}
path: Reveil.xcarchive
path: |
Reveil.xcarchive
ReveilHelper.xcarchive
Distribution/Reveil_${{ env.MARKETING_VERSION }}.tipa

- name: Upload release
- name: Upload Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
body_path: CHANGELOG.md
files: Reveil_${{ env.MARKETING_VERSION }}.tipa
files: Distribution/Reveil_${{ env.MARKETING_VERSION }}.tipa
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ DerivedData/
*.dSYM.zip
*.dSYM
*.xcarchive
Distribution

## Playgrounds
timeline.xctimeline
Expand Down
Binary file modified Certificates/Certificates.p12
Binary file not shown.
14 changes: 14 additions & 0 deletions ExportOptions.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>destination</key>
<string>upload</string>
<key>method</key>
<string>developer-id</string>
<key>signingStyle</key>
<string>automatic</string>
<key>teamID</key>
<string>GXZ23M5TP2</string>
</dict>
</plist>
Loading