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

First watch only #68

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
1b9752b
First watch only
Lightning-Lion Jan 12, 2024
9ea2f0c
First watch onlyV1
Lightning-Lion Jan 12, 2024
c19f8b1
Delete Package.swift
WindowsMEMZ Jan 12, 2024
b4649ea
Delete .DS_Store
WindowsMEMZ Jan 12, 2024
11c73fc
Delete Sources/DarockBili directory
WindowsMEMZ Jan 12, 2024
e8a9ee7
Delete Tests/DarockBiliTests directory
WindowsMEMZ Jan 12, 2024
adb3eac
Delete DarockBili Watch App/.DS_Store
WindowsMEMZ Jan 12, 2024
44157e2
Opt proj settings
WindowsMEMZ Jan 13, 2024
633197c
Fix build issue
WindowsMEMZ Jan 13, 2024
761ac01
Update ios.yml
WindowsMEMZ Jan 14, 2024
026357b
Update ad-hoc.plist
WindowsMEMZ Jan 14, 2024
cb465d6
Update ios.yml
WindowsMEMZ Jan 14, 2024
10cd363
Update ios.yml
WindowsMEMZ Jan 14, 2024
eb5216e
Update ios.yml
WindowsMEMZ Jan 14, 2024
481cca7
Update ios.yml
WindowsMEMZ Jan 14, 2024
ac4eee8
Update ios.yml
WindowsMEMZ Jan 14, 2024
5ab0dc8
Update ios.yml
WindowsMEMZ Jan 14, 2024
0fd73e4
Update ios.yml
WindowsMEMZ Jan 14, 2024
f66c83e
Update ios.yml
WindowsMEMZ Jan 14, 2024
f47e359
Update MainView.swift
WindowsMEMZ Jan 14, 2024
c8aa6e9
Update ios.yml
WindowsMEMZ Jan 14, 2024
3b67314
Update ios.yml
WindowsMEMZ Jan 14, 2024
faa39b3
Update ios.yml
WindowsMEMZ Jan 15, 2024
5e9671b
Update ios.yml
WindowsMEMZ Jan 15, 2024
1cb6de4
Update ios.yml
WindowsMEMZ Jan 15, 2024
a12d67a
Update ios.yml
WindowsMEMZ Jan 15, 2024
0fd5d9d
Update ios.yml
WindowsMEMZ Jan 15, 2024
51a56ab
Update ios.yml
WindowsMEMZ Jan 15, 2024
978f6cb
Update ios.yml
WindowsMEMZ Jan 15, 2024
71e3e86
Update ios.yml
WindowsMEMZ Jan 15, 2024
d01c71a
Update ios.yml
WindowsMEMZ Jan 15, 2024
83e6425
Update ios.yml
WindowsMEMZ Jan 15, 2024
2514dce
Update ios.yml
WindowsMEMZ Jan 15, 2024
55a5a42
Update ios.yml
WindowsMEMZ Jan 15, 2024
6afbeba
Update ios.yml
WindowsMEMZ Jan 16, 2024
56219c7
Update ios.yml
WindowsMEMZ Jan 16, 2024
f8ac6b8
Update project.pbxproj
WindowsMEMZ Jan 16, 2024
ccb45a0
Update ios.yml
WindowsMEMZ Jan 16, 2024
7e20f21
Update ios.yml
WindowsMEMZ Jan 16, 2024
66357db
Update ios.yml
WindowsMEMZ Jan 16, 2024
9747293
Update ios.yml
WindowsMEMZ Jan 16, 2024
b721cde
Update ios.yml
WindowsMEMZ Jan 16, 2024
3fab3b5
Update ios.yml
WindowsMEMZ Jan 16, 2024
1fc9768
Update ios.yml
WindowsMEMZ Jan 16, 2024
f195fcf
Update ad-hoc.plist
WindowsMEMZ Jan 16, 2024
503039c
Update ios.yml
WindowsMEMZ Jan 16, 2024
fc24f09
Update ios.yml
WindowsMEMZ Jan 16, 2024
cd1a576
Update ios.yml
WindowsMEMZ Jan 16, 2024
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
232 changes: 161 additions & 71 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: Meowbili iDevice Workflow

on:
push:
branches: [ "main" ]
branches: [ "main", "2024" ]
paths-ignore:
- '.github/workflows/*'
- '!.github/workflows/ios.yml'

jobs:
build:
name: Build and Archive App
prepare:
name: Prepare App Version
runs-on: macos-13
permissions:
contents: write
Expand Down Expand Up @@ -56,6 +56,27 @@ jobs:
branch: release-vers
directory: vers

- name: Upload Proj
uses: actions/upload-artifact@v3
with:
name: Versioned Project
path: ./

build:
name: Build and Archive App
runs-on: macos-13
needs:
- prepare
steps:
- name: Download Versioned Project
uses: actions/download-artifact@v3
with:
name: Versioned Project
path: ./

- name: Set Xcode Version
run: sudo xcode-select -s /Applications/Xcode_15.0.app

- name: Install the Apple certificate and provisioning profile for Xcode
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
Expand Down Expand Up @@ -100,7 +121,7 @@ jobs:
path: ~/Library/Developer/Xcode/DerivedData

- name: Resolve Package Dependencies
run: xcodebuild -resolvePackageDependencies -project ./DarockBili.xcodeproj -scheme DarockBili
run: xcodebuild -resolvePackageDependencies -project ./DarockBili.xcodeproj -scheme 'DarockBili Watch App'

- name: Get Current Time
id: current-time
Expand All @@ -117,74 +138,90 @@ jobs:
ASCAPI_KEY_ID: ${{ secrets.ASCAPI_KEY_ID }}
ASCAPI_ISSUER_ID: ${{ secrets.ASCAPI_ISSUER_ID }}
run: |
xcodebuild archive -project ./DarockBili.xcodeproj -scheme DarockBili -destination generic/platform=iOS -archivePath ./build.xcarchive -IDEPostProgressNotifications=YES CODE_SIGN_IDENTITY=- AD_HOC_CODE_SIGNING_ALLOWED=YES CODE_SIGN_STYLE=Automatic DEVELOPMENT_TEAM=B57D8PP775 COMPILER_INDEX_STORE_ENABLE=NO
xcodebuild archive -project ./DarockBili.xcodeproj -scheme 'DarockBili Watch App' -archivePath ./build.xcarchive -IDEPostProgressNotifications=YES CODE_SIGN_IDENTITY=- AD_HOC_CODE_SIGNING_ALLOWED=YES CODE_SIGN_STYLE=Automatic DEVELOPMENT_TEAM=B57D8PP775 COMPILER_INDEX_STORE_ENABLE=NO

- name: Upload Xcode Archive
uses: actions/upload-artifact@v3
with:
name: Xcode Archive
path: ./build.xcarchive

test:
build_comp:
name: Build Company App
runs-on: macos-13
name: Test App
needs:
- prepare
steps:
- uses: actions/checkout@v3

- name: Download Versioned Project
uses: actions/download-artifact@v3
with:
name: Versioned Project
path: ./

- name: Set Xcode Version
run: sudo xcode-select -s /Applications/Xcode_15.0.app

- name: Resolve Swift dependencies
run: xcodebuild -resolvePackageDependencies -scheme 'DarockBili Watch App' -configuration Release

- name: Prepare Cache Folder
run: mkdir Caches

- name: Build and Test
run: xcodebuild test -project ./DarockBili.xcodeproj -scheme 'DarockBili Watch App' -configuration Release -destination 'platform=watchOS Simulator,name=Apple Watch Series 7 (41mm),OS=10.0' -testPlan WatchAppUITestPlan -testProductsPath ./Caches/TestProducts.xctestproducts -derivedDataPath ./Caches/DerivedData | tee TestBuilding.log
- name: Install Apple certificate and provisioning profile for Xcode
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.COMPANY_P12 }}
P12_PASSWORD: ${{ secrets.COMPANY_P12_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.COMPANY_PROV }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles

- name: Upload Building Log
uses: actions/upload-artifact@v3
with:
name: Watch Testing Log
path: ./TestBuilding.log
- name: Replace Bundle ID
run: |
sed -i "" 's/com.darock.DarockBili.watchkitapp/com.djbx.life.agent.dat/g' DarockBili.xcodeproj/project.pbxproj
sed -i "" 's/com.darock.DarockBili/com.djbx.life.agent.dat/g' DarockBili.xcodeproj/project.pbxproj

- name: Upload Test Attachments
uses: actions/upload-artifact@v3
- name: Restore Caches
uses: actions/cache/restore@v3
with:
name: Test Attachments
path: ./Caches/DerivedData/Logs/Test
key: ${{ runner.os }}-main-archive-cache-
path: ~/Library/Developer/Xcode/DerivedData

process_test_result:
runs-on: macos-13
name: Process Test Result
needs:
- test
steps:
- name: Set Xcode Version
run: sudo xcode-select -s /Applications/Xcode_15.0.app
- name: Resolve Package Dependencies
run: xcodebuild -resolvePackageDependencies -project ./DarockBili.xcodeproj -scheme 'DarockBili Watch App'

- name: Prepare Environment
run: |
brew install chargepoint/xcparse/xcparse
- name: Get Current Time
id: current-time
run: echo "time=$(date +"%Y%m%d%H%M%S")" >> $GITHUB_OUTPUT

- name: Download Test Attachments
uses: actions/download-artifact@v3
- name: Save Caches
uses: actions/cache/save@v3
with:
name: Test Attachments
path: ./

- name: Process
key: ${{ runner.os }}-main-archive-cache-${{ steps.current-time.outputs.time }}
path: ~/Library/Developer/Xcode/DerivedData

- name: Archive DarockBili App
env:
COMPANY_PROV_UUID: ${{ secrets.COMPANY_PROV_UUID }}
COMPANY_P12_NAME: ${{ secrets.COMPANY_P12_NAME }}
run: |
mv ./Test-*.xcresult ./Test-1.xcresult
mkdir ExportFiles
xcparse -s ./Test-1.xcresult ./ExportFiles
xcodebuild archive -project ./DarockBili.xcodeproj -scheme 'DarockBili Watch App' -archivePath ./build.xcarchive -IDEPostProgressNotifications=YES CODE_SIGN_IDENTITY=- AD_HOC_CODE_SIGNING_ALLOWED=YES CODE_SIGN_STYLE=Automatic DEVELOPMENT_TEAM=H5SM6ZV38F COMPILER_INDEX_STORE_ENABLE=NO

- name: Upload Parsed Test Attachments
- name: Upload Xcode Archive
uses: actions/upload-artifact@v3
with:
name: Parsed Test Attachments
path: ./ExportFiles
name: Company Xcode Archive
path: ./build.xcarchive

export:
name: Export App Store IPA
Expand Down Expand Up @@ -279,26 +316,79 @@ jobs:
name: Unsigned IPA
path: ./DarockBili_Unsigned.ipa

# deploy:
# name: Deploy to TestFlight
# runs-on: macos-13
# needs:
# - export
# - test
# env:
# ASCAPI_ISSUER_ID: ${{ secrets.ASCAPI_ISSUER_ID }}
# ASCAPI_KEY_ID: ${{ secrets.ASCAPI_KEY_ID }}
# ASCAPI_KEY: ${{ secrets.ASCAPI_KEY }}
# steps:
# - name: Download App Archive
# uses: actions/download-artifact@v3
# with:
# name: Release IPA
#
# - name: Prepare API Key
# run: |
# mkdir ~/.private_keys
# echo "$ASCAPI_KEY" >> ~/.private_keys/AuthKey_${ASCAPI_KEY_ID}.p8
# - name: Upload to App Store Connect
# run: xcrun altool --upload-app -f ./DarockBili_Release.ipa -t ios --apiKey $ASCAPI_KEY_ID --apiIssuer $ASCAPI_ISSUER_ID
export_comp:
name: Export Company IPA
runs-on: macos-13
needs:
- build_comp
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set Xcode Version
run: sudo xcode-select -s /Applications/Xcode_15.0.app

- name: Download App XCArchive
uses: actions/download-artifact@v3
with:
name: Company Xcode Archive
path: ./DarockBili_Release.xcarchive

- name: Install Company Cer and Prov
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.COMPANY_P12 }}
P12_PASSWORD: ${{ secrets.COMPANY_P12_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.COMPANY_PROV }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles

- name: Export IPA File
run: |
xcodebuild -exportArchive -archivePath ./DarockBili_Release.xcarchive -exportPath ./ -exportOptionsPlist ./ExportOptions/ad-hoc.plist -DVTProvisioningIsManaged=YES -DVTSkipCertificateValidityCheck=YES
mv '喵哩喵哩.ipa' DarockBili_Company.ipa

- name: Upload IPA File
uses: actions/upload-artifact@v3
with:
name: Company IPA
path: ./DarockBili_Company.ipa

deploy:
name: Deploy to TestFlight
runs-on: macos-13
needs:
- export
env:
ASCAPI_ISSUER_ID: ${{ secrets.ASCAPI_ISSUER_ID }}
ASCAPI_KEY_ID: ${{ secrets.ASCAPI_KEY_ID }}
ASCAPI_KEY: ${{ secrets.ASCAPI_KEY }}
steps:
- name: Download App Archive
uses: actions/download-artifact@v3
with:
name: Release IPA

- name: Prepare API Key
run: |
mkdir ~/.private_keys
echo "$ASCAPI_KEY" >> ~/.private_keys/AuthKey_${ASCAPI_KEY_ID}.p8
- name: Upload to App Store Connect
run: xcrun altool --upload-app -f ./DarockBili_Release.ipa -t ios --apiKey $ASCAPI_KEY_ID --apiIssuer $ASCAPI_ISSUER_ID

Loading