From 3afba8b8db1b6d25bbc7b3c819fd931f1acea623 Mon Sep 17 00:00:00 2001 From: Vyrtsev Mikhail Date: Sat, 11 Jun 2022 15:04:37 +0300 Subject: [PATCH] Configure CI --- .github/workflows/create-release.yml | 47 ++++++++++++++++++++++++++++ MiddleMe.xcodeproj/project.pbxproj | 8 +++-- 2 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/create-release.yml diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 0000000..07d694d --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,47 @@ +name: "Release" +on: + push: + tags: + - "*.*" + +jobs: + release: + name: "Release" + runs-on: macos-latest + steps: + - name: "Checkout" + uses: actions/checkout@v1 + + - name: "Configure certificates" + run: > + echo $DISTRIBUTION_CERT_BASE_64 | base64 --decode > cert.p12 && + security create-keychain -p $KEYCHAIN_PASS $KEYCHAIN && + security default-keychain -s ~/Library/Keychains/$KEYCHAIN-db && + security set-keychain-settings $KEYCHAIN && + security list-keychains -s $KEYCHAIN && + security list-keychains && + security unlock-keychain -p $KEYCHAIN_PASS $KEYCHAIN && + security import ./cert.p12 -k $KEYCHAIN -P $DISTRIBUTION_CERT_PASS -A -T /usr/bin/codesign -T /usr/bin/security && + security set-key-partition-list -S apple-tool:,apple: -s -k $KEYCHAIN_PASS $KEYCHAIN && + security find-identity -p codesigning -v + env: + KEYCHAIN: "def.keychain" + KEYCHAIN_PASS: "hmmmm" + DISTRIBUTION_CERT_BASE_64: ${{ secrets.DISTRIBUTION_CERT_BASE_64 }} + DISTRIBUTION_CERT_PASS: ${{ secrets.DISTRIBUTION_CERT_PASS }} + + - name: "Install pods" + run: pod install + + - name: "Archive" + run: xcodebuild -workspace MiddleMe.xcworkspace -scheme MiddleMe -configuration Release archive -archivePath middleme.xcarchive + + - name: "Zip App" + run: pushd middleme.xcarchive/Products/Applications && zip --symlinks -r ../../../MiddleMe.zip MiddleMe.app && popd + + - name: "Create Release" + uses: softprops/action-gh-release@78c309ef59fdb9557cd6574f2e0be552936ed728 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + files: MiddleMe.zip diff --git a/MiddleMe.xcodeproj/project.pbxproj b/MiddleMe.xcodeproj/project.pbxproj index 7160fef..a5653fe 100644 --- a/MiddleMe.xcodeproj/project.pbxproj +++ b/MiddleMe.xcodeproj/project.pbxproj @@ -592,7 +592,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = MiddleMe/MiddleMe.entitlements; CODE_SIGN_IDENTITY = "-"; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"MiddleMe/Preview Content\""; @@ -609,6 +609,7 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.vyrtsev.mac.MiddleMe; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; }; @@ -621,8 +622,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = MiddleMe/MiddleMe.entitlements; - CODE_SIGN_IDENTITY = "-"; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_IDENTITY = "Developer ID Application"; + CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"MiddleMe/Preview Content\""; @@ -639,6 +640,7 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.vyrtsev.mac.MiddleMe; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; };