Merge pull request #503 from mastodon/ci-test
Add TestFlight build CI workflow
This commit is contained in:
commit
95481f1d6d
|
@ -0,0 +1,68 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -xeu
|
||||
set -o pipefail
|
||||
|
||||
function finish() {
|
||||
ditto -c -k --sequesterRsrc --keepParent "${RESULT_BUNDLE_PATH}" "${RESULT_BUNDLE_PATH}.zip"
|
||||
rm -rf "${RESULT_BUNDLE_PATH}"
|
||||
}
|
||||
|
||||
trap finish EXIT
|
||||
|
||||
SDK="${SDK:-iphoneos}"
|
||||
WORKSPACE="${WORKSPACE:-Mastodon.xcworkspace}"
|
||||
SCHEME="${SCHEME:-Mastodon}"
|
||||
CONFIGURATION=${CONFIGURATION:-Release}
|
||||
|
||||
BUILD_DIR=${BUILD_DIR:-.build}
|
||||
ARTIFACT_PATH=${RESULT_PATH:-${BUILD_DIR}/Artifacts}
|
||||
RESULT_BUNDLE_PATH="${ARTIFACT_PATH}/${SCHEME}.xcresult"
|
||||
ARCHIVE_PATH=${ARCHIVE_PATH:-${BUILD_DIR}/Archives/${SCHEME}.xcarchive}
|
||||
DERIVED_DATA_PATH=${DERIVED_DATA_PATH:-${BUILD_DIR}/DerivedData}
|
||||
CURRENT_PROJECT_VERSION=${BUILD_NUMBER:-0}
|
||||
EXPORT_OPTIONS_FILE=".github/support/ExportOptions.plist"
|
||||
|
||||
WORK_DIR=$(pwd)
|
||||
API_PRIVATE_KEYS_PATH="${WORK_DIR}/${BUILD_DIR}/private_keys"
|
||||
API_KEY_FILE="${API_PRIVATE_KEYS_PATH}/api_key.p8"
|
||||
|
||||
rm -rf "${RESULT_BUNDLE_PATH}"
|
||||
|
||||
rm -rf "${API_PRIVATE_KEYS_PATH}"
|
||||
mkdir -p "${API_PRIVATE_KEYS_PATH}"
|
||||
echo -n "${ENV_API_PRIVATE_KEY}" | base64 --decode > "${API_KEY_FILE}"
|
||||
|
||||
xcrun xcodebuild clean \
|
||||
-workspace "${WORKSPACE}" \
|
||||
-scheme "${SCHEME}" \
|
||||
-configuration "${CONFIGURATION}"
|
||||
|
||||
xcrun xcodebuild archive \
|
||||
-workspace "${WORKSPACE}" \
|
||||
-scheme "${SCHEME}" \
|
||||
-configuration "${CONFIGURATION}" \
|
||||
-destination generic/platform=iOS \
|
||||
-sdk "${SDK}" \
|
||||
-parallelizeTargets \
|
||||
-showBuildTimingSummary \
|
||||
-derivedDataPath "${DERIVED_DATA_PATH}" \
|
||||
-archivePath "${ARCHIVE_PATH}" \
|
||||
-resultBundlePath "${RESULT_BUNDLE_PATH}" \
|
||||
-allowProvisioningUpdates \
|
||||
-authenticationKeyPath "${API_KEY_FILE}" \
|
||||
-authenticationKeyID "${ENV_API_KEY_ID}" \
|
||||
-authenticationKeyIssuerID "${ENV_ISSUER_ID}"
|
||||
|
||||
xcrun xcodebuild \
|
||||
-exportArchive \
|
||||
-archivePath "${ARCHIVE_PATH}" \
|
||||
-exportOptionsPlist "${EXPORT_OPTIONS_FILE}" \
|
||||
-exportPath "${ARTIFACT_PATH}/${SCHEME}.ipa" \
|
||||
-allowProvisioningUpdates \
|
||||
-authenticationKeyPath "${API_KEY_FILE}" \
|
||||
-authenticationKeyID "${ENV_API_KEY_ID}" \
|
||||
-authenticationKeyIssuerID "${ENV_ISSUER_ID}"
|
||||
|
||||
# Zip up the Xcode Archive into Artifacts folder.
|
||||
ditto -c -k --sequesterRsrc --keepParent "${ARCHIVE_PATH}" "${ARTIFACT_PATH}/${SCHEME}.xcarchive.zip"
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# workaround https://github.com/CocoaPods/CocoaPods/issues/11355
|
||||
sed -i '' $'1s/^/source "https:\\/\\/github.com\\/CocoaPods\\/Specs.git"\\\n\\\n/' Podfile
|
||||
# sed -i '' $'1s/^/source "https:\\/\\/github.com\\/CocoaPods\\/Specs.git"\\\n\\\n/' Podfile
|
||||
|
||||
# Install Ruby Bundler
|
||||
gem install bundler:2.3.11
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<?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>method</key>
|
||||
<string>app-store</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,56 @@
|
|||
name: Build for Develop TestFlight
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- ci-test
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: macOS-12
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: setup
|
||||
env:
|
||||
NotificationEndpointDebug: ${{ secrets.NotificationEndpointDebug }}
|
||||
NotificationEndpointRelease: ${{ secrets.NotificationEndpointRelease }}
|
||||
run: exec ./.github/scripts/setup.sh
|
||||
|
||||
- name: Import Code-Signing Certificates
|
||||
uses: Apple-Actions/import-codesign-certs@v1 # https://github.com/Apple-Actions/import-codesign-certs
|
||||
with:
|
||||
keychain: build-p12
|
||||
p12-file-base64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
|
||||
p12-password: ${{ secrets.P12_PASSWORD }}
|
||||
|
||||
- name: Download Provisioning Profiles
|
||||
uses: Apple-Actions/download-provisioning-profiles@v1 # https://github.com/Apple-Actions/download-provisioning-profiles
|
||||
with:
|
||||
bundle-id: org.joinmastodon.app
|
||||
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
|
||||
api-key-id: ${{ secrets.APPSTORE_KEY_ID }}
|
||||
api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }}
|
||||
|
||||
- name: build
|
||||
env:
|
||||
ENV_ISSUER_ID: ${{ secrets.APPSTORE_ISSUER_ID }}
|
||||
ENV_API_KEY_ID: ${{ secrets.APPSTORE_KEY_ID }}
|
||||
ENV_API_PRIVATE_KEY: ${{ secrets.APP_STORE_CONNECT_KEY_BASE64 }}
|
||||
run: exec ./.github/scripts/build-release.sh
|
||||
|
||||
- name: Upload TestFlight Build
|
||||
uses: Apple-Actions/upload-testflight-build@master
|
||||
with:
|
||||
app-path: .build/Artifacts/Mastodon.ipa/Mastodon.ipa
|
||||
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
|
||||
api-key-id: ${{ secrets.APPSTORE_KEY_ID }}
|
||||
api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }}
|
||||
|
||||
- name: Clean up keychain and provisioning profile
|
||||
if: ${{ always() }}
|
||||
run: |
|
||||
security delete-keychain build-p12.keychain-db
|
|
@ -3874,7 +3874,6 @@
|
|||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.4.5;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
|
@ -3904,7 +3903,6 @@
|
|||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.4.5;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
|
@ -4077,7 +4075,6 @@
|
|||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.4.5;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
|
@ -4144,7 +4141,6 @@
|
|||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.7;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.NotificationService;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
@ -4167,7 +4163,6 @@
|
|||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.7;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.ShareActionExtension;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
@ -4191,7 +4186,6 @@
|
|||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.7;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.MastodonIntent;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
@ -4215,7 +4209,6 @@
|
|||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.7;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.MastodonIntent;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
@ -4239,7 +4232,6 @@
|
|||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.7;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.MastodonIntent;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
@ -4263,7 +4255,6 @@
|
|||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.7;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.ShareActionExtension;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
@ -4287,7 +4278,6 @@
|
|||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.7;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.ShareActionExtension;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
@ -4374,7 +4364,6 @@
|
|||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.4.5;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
|
@ -4426,36 +4415,6 @@
|
|||
};
|
||||
name = "Release Snapshot";
|
||||
};
|
||||
DBEB19E527E4658E00B0E80E /* Release Snapshot */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 3E08A432F40BA7B9CAA9DB68 /* Pods-AppShared.release snapshot.xcconfig */;
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 147;
|
||||
DEFINES_MODULE = YES;
|
||||
DEVELOPMENT_TEAM = 5Z4GVSS33P;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 147;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
INFOPLIST_FILE = AppShared/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
"@loader_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.AppShared;
|
||||
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = "Release Snapshot";
|
||||
};
|
||||
DBEB19E627E4658E00B0E80E /* Release Snapshot */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
|
@ -4470,7 +4429,6 @@
|
|||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.7;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.NotificationService;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
@ -4493,7 +4451,6 @@
|
|||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.7;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.ShareActionExtension;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
@ -4517,7 +4474,6 @@
|
|||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.7;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.MastodonIntent;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
@ -4542,7 +4498,6 @@
|
|||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.7;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.NotificationService;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
@ -4566,7 +4521,6 @@
|
|||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.7;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.NotificationService;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
|
|
@ -117,12 +117,12 @@
|
|||
<key>NotificationService.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>24</integer>
|
||||
<integer>18</integer>
|
||||
</dict>
|
||||
<key>ShareActionExtension.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>25</integer>
|
||||
<integer>17</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>SuppressBuildableAutocreation</key>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.4.6</string>
|
||||
<string>1.4.7</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
|
|
|
@ -162,7 +162,7 @@ extension ReportViewModel {
|
|||
#else
|
||||
let _ = try await context.apiService.report(
|
||||
query: query,
|
||||
authenticationBox: authenticationBox
|
||||
authenticationBox: authContext.mastodonAuthenticationBox
|
||||
)
|
||||
#endif
|
||||
isReportSuccess = true
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.4.6</string>
|
||||
<string>1.4.7</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>147</string>
|
||||
<key>NSExtension</key>
|
||||
|
|
|
@ -11,7 +11,7 @@ import Combine
|
|||
|
||||
extension APIService {
|
||||
|
||||
func report(
|
||||
public func report(
|
||||
query: Mastodon.API.Reports.FileReportQuery,
|
||||
authenticationBox: MastodonAuthenticationBox
|
||||
) async throws -> Mastodon.Response.Content<Bool> {
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.4.6</string>
|
||||
<string>1.4.7</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>147</string>
|
||||
</dict>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.4.6</string>
|
||||
<string>1.4.7</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>147</string>
|
||||
</dict>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.4.6</string>
|
||||
<string>1.4.7</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>147</string>
|
||||
<key>NSExtension</key>
|
||||
|
|
7
Podfile
7
Podfile
|
@ -1,3 +1,4 @@
|
|||
source 'https://cdn.cocoapods.org/'
|
||||
platform :ios, '14.0'
|
||||
|
||||
target 'Mastodon' do
|
||||
|
@ -35,5 +36,11 @@ post_install do |installer|
|
|||
target.build_configurations.each do |config|
|
||||
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
|
||||
end
|
||||
# https://github.com/CocoaPods/CocoaPods/issues/11402#issuecomment-1201464693
|
||||
if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
|
||||
target.build_configurations.each do |config|
|
||||
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -37,6 +37,6 @@ SPEC CHECKSUMS:
|
|||
"UITextField+Shake": 298ac5a0f239d731bdab999b19b628c956ca0ac3
|
||||
XLPagerTabStrip: 61c57fd61f611ee5f01ff1495ad6fbee8bf496c5
|
||||
|
||||
PODFILE CHECKSUM: 50ec5b2c4aa189024cc5ab41039f983dc5609040
|
||||
PODFILE CHECKSUM: 8b15fb6d4e801b7a7e7761a2e2fe40a89b1da4ff
|
||||
|
||||
COCOAPODS: 1.11.3
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.4.6</string>
|
||||
<string>1.4.7</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>147</string>
|
||||
<key>NSExtension</key>
|
||||
|
|
Loading…
Reference in New Issue