Update GitHub workflows

This commit is contained in:
Nindi Gill 2022-12-08 14:30:00 +11:00
parent 20c96ab2d4
commit 5ec025d8d0
7 changed files with 250 additions and 12 deletions

36
.github/workflows/build_app.yml vendored Normal file
View file

@ -0,0 +1,36 @@
name: Build Mist
on: [push, pull_request]
jobs:
build-app:
name: Build Mist
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: swift-actions/setup-swift@v1
- name: Install Apple Developer Application Certificate
env:
APPLE_DEVELOPER_CERTIFICATE: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE }}
APPLE_DEVELOPER_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
APPLE_DEVELOPER_CERTIFICATE_AUTHORITY: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_AUTHORITY }}
APPLE_DEVELOPER_KEYCHAIN_PASSWORD: ${{ secrets.APPLE_DEVELOPER_KEYCHAIN_PASSWORD }}
run: |
CERTIFICATE_PATH="$RUNNER_TEMP/apple-developer-application-certificate.p12"
CERTIFICATE_AUTHORITY_PATH="$RUNNER_TEMP/apple-developer-certificate-authority.cer"
KEYCHAIN_PATH="$RUNNER_TEMP/apple-developer.keychain-db"
echo -n "$APPLE_DEVELOPER_CERTIFICATE" | base64 --decode --output "$CERTIFICATE_PATH"
echo -n "$APPLE_DEVELOPER_CERTIFICATE_AUTHORITY" | base64 --decode --output "$CERTIFICATE_AUTHORITY_PATH"
security create-keychain -p "$APPLE_DEVELOPER_KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH"
security unlock-keychain -p "$APPLE_DEVELOPER_KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
security import "$CERTIFICATE_PATH" -P "$APPLE_DEVELOPER_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH"
security import "$CERTIFICATE_AUTHORITY_PATH" -P "$APPLE_DEVELOPER_CERTIFICATE_PASSWORD" -A -t cert -f pkcs7 -k "$KEYCHAIN_PATH"
security list-keychain -d user -s "$KEYCHAIN_PATH"
- name: Archive Mist
run: xcodebuild -scheme Mist clean archive -configuration release -archivePath Mist -quiet
- name: Export Mist
run: xcodebuild -exportArchive -archivePath Mist.xcarchive -exportPath Export -exportOptionsPlist ExportOptions.plist
- name: Print Mist version
run: defaults read Export/Mist.app CFBundleShortVersionString
- name: Remove Apple Developer Keychain
if: ${{ always() }}
run: security delete-keychain $RUNNER_TEMP/apple-developer.keychain-db

View file

@ -1,12 +1,11 @@
name: Do all of the things!
name: Lint Codebase
on: [push, pull_request]
jobs:
do-all-of-the-things:
name: Do all of the things!
lint-codebase:
name: Lint Codebase
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: swift-actions/setup-swift@v1
- name: Print SwiftLint version
run: swiftlint --version
- name: Run SwiftLint
@ -23,9 +22,3 @@ jobs:
run: drstring --version
- name: Run DrString
run: drstring check --config-file .drstring.toml
- name: Archive Mist
run: xcodebuild -scheme Mist clean archive -configuration release -archivePath Mist
- name: Export Mist
run: xcodebuild -exportArchive -archivePath Mist.xcarchive -exportPath Export -exportOptionsPlist ExportOptions.plist
- name: Print Mist version
run: defaults read Export/Mist.app CFBundleShortVersionString

10
.github/workflows/run_unit_tests.yml vendored Normal file
View file

@ -0,0 +1,10 @@
name: Run Unit Tests
on: [push, pull_request]
jobs:
run_unit_tests:
name: Run Unit Tests
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Run Unit Tests
run: xcodebuild -scheme MistTests clean test -quiet