-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'chore/ci-cd' into 'main':
commit a41df3909438d00f917f6160cbc32be352196b25 Author: Lukas Pistrol <lukas@pistrol.com> Date: Mon Nov 13 18:10:52 2023 +0100 add build only workflow commit 2c2e291 Author: Lukas Pistrol <lukas@pistrol.com> Date: Mon Nov 13 18:06:57 2023 +0100 cleanup commit 2ef98b8 Author: Lukas Pistrol <lukas@pistrol.com> Date: Mon Nov 13 17:50:21 2023 +0100 install mac signing cert commit 99bdb6a Author: Lukas Pistrol <lukas@pistrol.com> Date: Mon Nov 13 17:41:08 2023 +0100 disable xcpretty commit 324b955 Author: Lukas Pistrol <lukas@pistrol.com> Date: Mon Nov 13 17:40:53 2023 +0100 disable xcpretty commit 78a952e Author: Lukas Pistrol <lukas@pistrol.com> Date: Mon Nov 13 17:35:10 2023 +0100 use RUNNER_TEMP as build directory commit bfceeb9 Author: Lukas Pistrol <lukas@pistrol.com> Date: Mon Nov 13 17:29:29 2023 +0100 test commit c23a764 Author: Lukas Pistrol <lukas@pistrol.com> Date: Mon Nov 13 17:09:57 2023 +0100 use xcode 15 commit 1e096a7 Author: Lukas Pistrol <lukas@pistrol.com> Date: Mon Nov 13 17:07:41 2023 +0100 add trigger commit e2585d5 Author: Lukas Pistrol <lukas@pistrol.com> Date: Mon Nov 13 16:58:59 2023 +0100 initial implementation of codesigning and notarization whatever
- Loading branch information
1 parent
7c267b9
commit eb3c2b9
Showing
6 changed files
with
162 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Build (PR) | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer | ||
|
||
jobs: | ||
build: | ||
name: Build and Publish Release | ||
runs-on: macOS-13 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install certificates | ||
env: | ||
MAC_SIGN_CERT: ${{ secrets.MAC_SIGN_CERT }} | ||
MAC_SIGN_PW: ${{ secrets.MAC_SIGN_PW }} | ||
KEYCHAIN_TIMEOUT: 21600 | ||
run: | | ||
MAC_CERT_P12="$RUNNER_TEMP/mac_cert.p12" | ||
KEYCHAIN_DB="$RUNNER_TEMP/keychain.keychain-db" | ||
KEYCHAIN_PW=$(openssl rand -base64 24) | ||
security create-keychain -p "$KEYCHAIN_PW" "$KEYCHAIN_DB" | ||
security set-keychain-settings -lut "$KEYCHAIN_TIMEOUT" "$KEYCHAIN_DB" | ||
security unlock-keychain -p "$KEYCHAIN_PW" "$KEYCHAIN_DB" | ||
echo -n "$MAC_SIGN_CERT" | base64 --decode -o "$MAC_CERT_P12" | ||
security import "$MAC_CERT_P12" -P "$MAC_SIGN_PW" -A -t cert -f pkcs12 -k "$KEYCHAIN_DB" | ||
security list-keychain -d user -s "$KEYCHAIN_DB" | ||
- name: Build | ||
env: | ||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | ||
run: | | ||
set -o pipefail && xcodebuild build -project "TimeMachineStatus.xcodeproj" \ | ||
-scheme "TimeMachineStatus" \ | ||
-configuration "Release" \ | ||
-derivedDataPath "$RUNNER_TEMP/DerivedData" \ | ||
DEVELOPMENT_TEAM=$APPLE_TEAM_ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
name: Build & Publish | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer | ||
|
||
jobs: | ||
build: | ||
name: Build and Publish Release | ||
runs-on: macOS-13 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Tooling | ||
run: | | ||
brew install create-dmg | ||
- name: Install certificates | ||
env: | ||
DEV_SIGN_CERT: ${{ secrets.DEV_SIGN_CERT }} | ||
DEV_SIGN_PW: ${{ secrets.DEV_SIGN_PW }} | ||
MAC_SIGN_CERT: ${{ secrets.MAC_SIGN_CERT }} | ||
MAC_SIGN_PW: ${{ secrets.MAC_SIGN_PW }} | ||
KEYCHAIN_TIMEOUT: 21600 | ||
run: | | ||
DEV_CERT_P12="$RUNNER_TEMP/dev_cert.p12" | ||
MAC_CERT_P12="$RUNNER_TEMP/mac_cert.p12" | ||
KEYCHAIN_DB="$RUNNER_TEMP/keychain.keychain-db" | ||
KEYCHAIN_PW=$(openssl rand -base64 24) | ||
security create-keychain -p "$KEYCHAIN_PW" "$KEYCHAIN_DB" | ||
security set-keychain-settings -lut "$KEYCHAIN_TIMEOUT" "$KEYCHAIN_DB" | ||
security unlock-keychain -p "$KEYCHAIN_PW" "$KEYCHAIN_DB" | ||
echo -n "$DEV_SIGN_CERT" | base64 --decode -o "$DEV_CERT_P12" | ||
security import "$DEV_CERT_P12" -P "$DEV_SIGN_PW" -A -t cert -f pkcs12 -k "$KEYCHAIN_DB" | ||
echo -n "$MAC_SIGN_CERT" | base64 --decode -o "$MAC_CERT_P12" | ||
security import "$MAC_CERT_P12" -P "$MAC_SIGN_PW" -A -t cert -f pkcs12 -k "$KEYCHAIN_DB" | ||
security list-keychain -d user -s "$KEYCHAIN_DB" | ||
- name: Build | ||
env: | ||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | ||
run: | | ||
set -o pipefail && xcodebuild archive -project "TimeMachineStatus.xcodeproj" \ | ||
-scheme "TimeMachineStatus" \ | ||
-configuration "Release" \ | ||
-derivedDataPath "$RUNNER_TEMP/DerivedData" \ | ||
-archivePath "$RUNNER_TEMP/TimeMachineStatus.xcarchive" \ | ||
DEVELOPMENT_TEAM=$APPLE_TEAM_ID | ||
- name: Sign | ||
env: | ||
CODE_SIGN_IDENTITY: ${{ secrets.CODE_SIGN_IDENTITY }} | ||
run: | | ||
codesign \ | ||
--sign "$CODE_SIGN_IDENTITY" \ | ||
-vvv --verbose --strict \ | ||
--options=runtime \ | ||
--prefix com.lukaspistrol.TimeMachineStatus \ | ||
--force --deep --timestamp \ | ||
"$RUNNER_TEMP/TimeMachineStatus.xcarchive/Products/Applications/TimeMachineStatus.app" | ||
- name: Create DMG | ||
env: | ||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | ||
APPLE_ID: ${{ secrets.APPLE_ID }} | ||
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} | ||
run: | | ||
xcrun notarytool store-credentials TimeMachineStatus \ | ||
--apple-id "$APPLE_ID" \ | ||
--team-id "$APPLE_TEAM_ID" \ | ||
--password "$APPLE_ID_PASSWORD" | ||
create-dmg \ | ||
--volname "TimeMachineStatus" \ | ||
--volicon "$RUNNER_TEMP/TimeMachineStatus.xcarchive/Products/Applications/TimeMachineStatus.app/Contents/Resources/AppIcon.icns" \ | ||
--window-pos 200 120 \ | ||
--window-size 800 400 \ | ||
--icon-size 100 \ | ||
--icon "TimeMachineStatus.app" 200 190 \ | ||
--hide-extension "TimeMachineStatus.app" \ | ||
--app-drop-link 600 185 \ | ||
--notarize "TimeMachineStatus" \ | ||
--skip-jenkins \ | ||
"$RUNNER_TEMP/TimeMachineStatus.dmg" \ | ||
"$RUNNER_TEMP/TimeMachineStatus.xcarchive/Products/Applications/TimeMachineStatus.app" | ||
- name: Clean up keychain and provisioning profile | ||
if: ${{ always() }} | ||
run: | | ||
security delete-keychain "$RUNNER_TEMP/keychain.keychain-db" | ||
rm -rf "~/Library/MobileDevice/Provisioning Profiles" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,3 +88,5 @@ fastlane/test_output | |
# https://github.com/johnno1962/injectionforxcode | ||
|
||
iOSInjectionProject/ | ||
|
||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters