diff --git a/.github/workflows/deploying.yml b/.github/workflows/deploying.yml new file mode 100644 index 0000000..b21f353 --- /dev/null +++ b/.github/workflows/deploying.yml @@ -0,0 +1,47 @@ +name: CI + +on: + push: + branches: + - master + +jobs: + build: + runs-on: macos-latest + strategy: + matrix: + channel: ['beta', 'release'] + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: | + brew install libtool automake cmake carthage go@1.14 swiftlint swiftformat + gem install bundler + - name: Prepare dependencies + run: | + export PATH="/usr/local/opt/go@1.14/bin:$PATH" + bundle install + bundle exec pod install + ./wcarthage bootstrap --platform iOS + ./gopenpgp_build.sh + - name: Test + run: bundle exec fastlane test + - name: Deploy + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + run: bundle exec fastlane ${{ matrix.channel }} + env: + APPLE_ID: ${{ secrets.APPLE_ID }} + APP_IDENTIFIER: ${{ secrets.APP_IDENTIFIER }} + DESTINATION_EMAIL: ${{ secrets.DESTINATION_EMAIL }} + EMAIL_FROM_NAME: ${{ secrets.EMAIL_FROM_NAME }} + EMAIL_REPLY_TO: ${{ secrets.EMAIL_REPLY_TO }} + FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }} + FASTLANE_USER: ${{ secrets.FASTLANE_USER }} + ITC_TEAM_ID: ${{ secrets.ITC_TEAM_ID }} + MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }} + MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} + MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + MY_API_KEY: ${{ secrets.MY_API_KEY }} + MY_POSTMASTER: ${{ secrets.MY_POSTMASTER }} + TEAM_ID: ${{ secrets.TEAM_ID }} diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml new file mode 100644 index 0000000..589b522 --- /dev/null +++ b/.github/workflows/linting.yml @@ -0,0 +1,24 @@ +name: Linting + +on: pull_request + +jobs: + swiftformat: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: Installing packages + run: brew update && brew install swiftformat + - name: swiftformat + run: | + swiftformat --lint . + + swiftlint: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: Installing packages + run: brew update && brew upgrade swiftlint + - name: swiftlint + run: | + swiftlint --strict diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml new file mode 100644 index 0000000..15f6117 --- /dev/null +++ b/.github/workflows/testing.yml @@ -0,0 +1,22 @@ +name: Testing + +on: pull_request + +jobs: + testing: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: Installing packages + run: | + brew install libtool automake cmake carthage go@1.14 swiftlint swiftformat + gem install bundler + - name: Preparing dependencies + run: | + export PATH="/usr/local/opt/go@1.14/bin:$PATH" + bundle install + bundle exec pod install + ./wcarthage bootstrap --platform iOS + ./gopenpgp_build.sh + - name: Testing + run: bundle exec fastlane test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a2a7fc9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,55 +0,0 @@ -language: objective-c -osx_image: xcode12 -addons: - homebrew: - packages: - - go@1.14 - - gnupg2 - - pass - update: true - ssh_known_hosts: github.com -before_install: - - echo -e "machine github.com\n login $GITHUB_ACCESS_TOKEN" >> ~/.netrc - - touch .ci-env -install: - - gem install bundler - - bundle install -before_script: - - pod install - - git diff --quiet "$TRAVIS_COMMIT_RANGE" -- ; GIT_DIFF_EXIT_CODE=$? - - | - if [ "$GIT_DIFF_EXIT_CODE" -gt 1 ] ; then - git remote set-branches --add origin master - git fetch - TRAVIS_COMMIT_RANGE=origin/master... - fi - - echo $TRAVIS_COMMIT_RANGE - - | - if [ ! $(git diff --name-only "$TRAVIS_COMMIT_RANGE" | grep "Cartfile.resolved") ] && [ -d "Carthage/Build" ]; then - echo "Use cached carthage dependencies." - ls -ld Carthage/Build/iOS/*framework - else - echo "Bootstrap carthage dependencies." - travis_wait 80 ./wcarthage bootstrap --platform iOS - fi - - | - export PATH="/usr/local/opt/go@1.14/bin:$PATH" - if [ ! $(git diff --name-only "$TRAVIS_COMMIT_RANGE" | grep -E "gopenpgp_build.sh") ] && [ -d "go/dist/Crypto.framework" ]; then - echo "Use cached go dependencies." - ls -ld go/dist/*framework - else - echo "Build go dependencies." - ./gopenpgp_build.sh - fi -script: - - if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_EVENT_TYPE" = "push" ]; then bundle exec fastlane test && bundle exec fastlane "$CHANNEL"; else bundle exec fastlane test; fi -cache: - directories: - - Carthage - - go/dist -env: - jobs: - - CHANNEL=beta - - CHANNEL=release - global: - - secure: NsbIgKZAO1Rhr/QUFsvs5LjOGf4vFIWqCJNr+zhw9DKnOd+G8m1z9wsfNyUhg+v1eUONVMxI/FTeAobnn20kxetw1dMQn4/rL4+IB4UsmODuwcFF7JCUAzEB2Wv82O91nVwT48zEmNyOG2VkgfqOgHeASStQyDPFzJuyXFy+RzoBNKK3X7Uxk19UQI80UmXvW9bmQuY8O37g/qwFj4mnluNvPIvGHry0LPMlbh6fRPsHwXlDmD2FSLoW3GI3PLN1pWsIXLURUr3bioLBJ3E0tzZsFA4AM0xs9Y7Td9f87zo4pRTAH5p2EieSq5IfNS2RDQh5aftrLFBZPUui/86yc9hoceLuOVQKkByBavMBVzfIAiAoJZdBX9cTNDh+zzFs+WZKfP4jYnN1xrFPBmHOG5kVRiA++UbepferDjr80A5aXU3FLjOeuKKrkLvAphGRMwsbx9omYHjAa2eaf2oaLeKLENkl/C/6CeG4D1F/PLsdsjilfHEQKroDRWgxU2Se+bKYucmpBXa8fjWHUyr4pfcgc6qB/R62TxYBI94QSbWAEwE6eEzUlmBoids1l5KTWqnMqXYHlxNXNao2RxV2aqwq5OuWqg1hYBxXVBUKGvzXYONnsxfgcc7NLuTPfeR/h1v7CYcs6VG+z2rYJNY5pBTHrYzeNG0RbDNq3ofMl+M= diff --git a/Gemfile b/Gemfile index 89348b9..ccb607c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,6 @@ source "https://rubygems.org" +gem "cocoapods" gem "fastlane" gem "xcodeproj" gem "rest-client" diff --git a/Gemfile.lock b/Gemfile.lock index 3047811..f7df52e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,8 +2,16 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (3.0.2) + activesupport (4.2.11.3) + i18n (~> 0.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) + algoliasearch (1.27.5) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) atomos (0.1.3) aws-eventstream (1.1.0) aws-partitions (1.345.0) @@ -23,10 +31,48 @@ GEM aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.3) claide (1.0.3) + cocoapods (1.9.3) + activesupport (>= 4.0.2, < 5) + claide (>= 1.0.2, < 2.0) + cocoapods-core (= 1.9.3) + cocoapods-deintegrate (>= 1.0.3, < 2.0) + cocoapods-downloader (>= 1.2.2, < 2.0) + cocoapods-plugins (>= 1.0.0, < 2.0) + cocoapods-search (>= 1.0.0, < 2.0) + cocoapods-stats (>= 1.0.0, < 2.0) + cocoapods-trunk (>= 1.4.0, < 2.0) + cocoapods-try (>= 1.1.0, < 2.0) + colored2 (~> 3.1) + escape (~> 0.0.4) + fourflusher (>= 2.3.0, < 3.0) + gh_inspector (~> 1.0) + molinillo (~> 0.6.6) + nap (~> 1.0) + ruby-macho (~> 1.4) + xcodeproj (>= 1.14.0, < 2.0) + cocoapods-core (1.9.3) + activesupport (>= 4.0.2, < 6) + algoliasearch (~> 1.0) + concurrent-ruby (~> 1.1) + fuzzy_match (~> 2.0.4) + nap (~> 1.0) + netrc (~> 0.11) + typhoeus (~> 1.0) + cocoapods-deintegrate (1.0.4) + cocoapods-downloader (1.4.0) + cocoapods-plugins (1.0.0) + nap + cocoapods-search (1.0.0) + cocoapods-stats (1.1.0) + cocoapods-trunk (1.5.0) + nap (>= 0.8, < 2.0) + netrc (~> 0.11) + cocoapods-try (1.2.0) colored (1.2) colored2 (3.1.2) commander-fastlane (4.4.6) highline (~> 1.7.2) + concurrent-ruby (1.1.7) declarative (0.0.20) declarative-option (0.1.0) digest-crc (0.6.1) @@ -35,6 +81,9 @@ GEM unf (>= 0.0.5, < 1.0.0) dotenv (2.7.6) emoji_regex (3.0.0) + escape (0.0.4) + ethon (0.12.0) + ffi (>= 1.3.0) excon (0.75.0) faraday (1.0.1) multipart-post (>= 1.2, < 3) @@ -80,6 +129,9 @@ GEM xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) + ffi (1.13.1) + fourflusher (2.3.1) + fuzzy_match (2.0.4) gh_inspector (1.1.3) google-api-client (0.38.0) addressable (~> 2.5, >= 2.5.1) @@ -114,6 +166,8 @@ GEM http-cookie (1.0.3) domain_name (~> 0.5) httpclient (2.8.3) + i18n (0.9.5) + concurrent-ruby (~> 1.0) jmespath (1.4.0) json (2.3.1) jwt (2.2.1) @@ -123,9 +177,12 @@ GEM mime-types-data (3.2020.0512) mini_magick (4.10.1) mini_mime (1.0.2) + minitest (5.14.2) + molinillo (0.6.6) multi_json (1.15.0) multipart-post (2.0.0) nanaimo (0.3.0) + nap (1.1.0) naturally (2.2.0) netrc (0.11.0) os (1.1.0) @@ -143,6 +200,7 @@ GEM netrc (~> 0.8) retriable (3.1.2) rouge (2.0.7) + ruby-macho (1.4.0) rubyzip (2.3.0) security (0.1.3) signet (0.14.0) @@ -157,10 +215,15 @@ GEM terminal-notifier (2.0.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) + thread_safe (0.3.6) tty-cursor (0.7.1) tty-screen (0.8.1) tty-spinner (0.9.3) tty-cursor (~> 0.7) + typhoeus (1.4.0) + ethon (>= 0.9.0) + tzinfo (1.2.8) + thread_safe (~> 0.1) uber (0.1.0) unf (0.1.4) unf_ext @@ -182,6 +245,7 @@ PLATFORMS ruby DEPENDENCIES + cocoapods fastlane rest-client xcodeproj diff --git a/README.md b/README.md index fef9a03..03b10da 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # Pass [![GitHub release](https://img.shields.io/github/release/mssun/passforios.svg)](https://github.com/mssun/passforios/releases) [![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/passforios/passforios) -[![Build Status](https://travis-ci.org/mssun/passforios.svg?branch=develop)](https://travis-ci.org/mssun/passforios) +[![Build Status](https://github.com/mssun/passforios/workflows/Testing/badge.svg)](https://github.com/mssun/passforios/actions) [![Donate](https://img.shields.io/badge/paypal-donate-blue.svg)](https://www.paypal.me/mssun) Pass is an iOS client compatible with [ZX2C4's Pass command line application](http://www.passwordstore.org/). diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 67dd63a..5266fd9 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -169,8 +169,8 @@ platform :ios do subject: "A new build of Pass for iOS has been uploaded", success: true, app_link: "https://github.com/mssun/passforios", - ci_build_link: "https://travis-ci.org/mssun/passforios", - message: "A new build has been uploaded by Travis CI.", + ci_build_link: "https://github.com/mssun/passforios/actions", + message: "A new build has been uploaded by GitHub Action.", ) end end diff --git a/scripts/swiftformat.sh b/scripts/swiftformat.sh index 88d892b..728d5ad 100755 --- a/scripts/swiftformat.sh +++ b/scripts/swiftformat.sh @@ -1,6 +1,6 @@ SWIFTFORMAT_VERSION="0.47.*" -if [[ -f "${SRCROOT}/.ci-env" ]]; then +if [[ "${CI}" == "true" ]]; then echo "Running in a Continuous Integration environment. Formatting is skipped." return fi diff --git a/scripts/swiftlint.sh b/scripts/swiftlint.sh index 9092d28..db8177c 100755 --- a/scripts/swiftlint.sh +++ b/scripts/swiftlint.sh @@ -1,6 +1,6 @@ SWIFTLINT_VERSION="0.42.*" -if [[ -f "${SRCROOT}/.ci-env" ]]; then +if [[ "${CI}" == "true" ]]; then echo "Running in a Continuous Integration environment. Linting is skipped." return fi diff --git a/wcarthage b/wcarthage index 5f70c40..84edae6 100755 --- a/wcarthage +++ b/wcarthage @@ -6,6 +6,28 @@ set -euo pipefail xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX) trap 'rm -f "$xcconfig"' INT TERM HUP EXIT +# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise +# the build will fail on lipo due to duplicate architectures. +# Xcode 12 Beta 3: +echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_12A8169g = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig +# Xcode 12 beta 4 +echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_12A8179i = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig +# Xcode 12 beta 5 +echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_12A8189h = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig +# Xcode 12 beta 6 +echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_12A8189n = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig +# Xcode 12 GM +echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_12A7209 = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig +# Xcode 12.1 (12A7300) +echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_12A7300 = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig +# Xcode 12.1 (12A7403) +echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_12A7403 = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig + +echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$(XCODE_PRODUCT_BUILD_VERSION))' >> $xcconfig +echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig + +export XCODE_XCCONFIG_FILE="$xcconfig" + # For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise # the build will fail on lipo due to duplicate architectures.