From 728f97ade29b94a5a5313b69ef0655cf32e49d87 Mon Sep 17 00:00:00 2001 From: Alberto De Bortoli Date: Sun, 15 May 2022 16:51:22 +0100 Subject: [PATCH 1/3] Add publish-to-trunk-workflow.yml --- .../workflows/publish-to-trunk-workflow.yml | 20 +++++++++++++++++++ .github/workflows/pull-request-workflow.yml | 4 ++-- JustTweak.podspec | 2 +- 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/publish-to-trunk-workflow.yml diff --git a/.github/workflows/publish-to-trunk-workflow.yml b/.github/workflows/publish-to-trunk-workflow.yml new file mode 100644 index 0000000..0dcbbe0 --- /dev/null +++ b/.github/workflows/publish-to-trunk-workflow.yml @@ -0,0 +1,20 @@ +name: Publish to Trunk +on: + push: + tags: + - '*' +jobs: + build: + runs-on: macOS-latest + steps: + - uses: actions/checkout@v1 + - name: Install Cocoapods + run: gem install cocoapods + - name: Deploy to Cocoapods + run: | + set -eo pipefail + export LIB_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`) + pod lib lint --allow-warnings + pod trunk push --allow-warnings + env: + COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} diff --git a/.github/workflows/pull-request-workflow.yml b/.github/workflows/pull-request-workflow.yml index 3fb98f3..3d90bad 100644 --- a/.github/workflows/pull-request-workflow.yml +++ b/.github/workflows/pull-request-workflow.yml @@ -2,7 +2,7 @@ name: Pull Request Workflow on: [pull_request] jobs: run-tests: - runs-on: macos-11 + runs-on: macOS-latest timeout-minutes: 15 steps: - name: Cancel previous jobs @@ -16,7 +16,7 @@ jobs: - name: Setup Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '13.2.1' + xcode-version: '13.3.1' - name: Setup ruby and bundler dependencies uses: ruby/setup-ruby@v1.81.0 with: diff --git a/JustTweak.podspec b/JustTweak.podspec index 5525e57..b1a9f78 100644 --- a/JustTweak.podspec +++ b/JustTweak.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'JustTweak' - s.version = '10.0.3' + s.version = ENV['LIB_VERSION'] s.summary = 'A framework for feature flagging, locally and remotely configure and A/B test iOS apps.' s.description = <<-DESC JustTweak is a framework for feature flagging, locally and remotely configure and A/B test iOS apps. From 3e7997c912318005face422f0c58c6f14b06298e Mon Sep 17 00:00:00 2001 From: Alberto De Bortoli Date: Sun, 15 May 2022 17:15:42 +0100 Subject: [PATCH 2/3] Use Xcode 13.2.1 in pull-request-workflow.yml --- .github/workflows/pull-request-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-workflow.yml b/.github/workflows/pull-request-workflow.yml index 3d90bad..d4a633a 100644 --- a/.github/workflows/pull-request-workflow.yml +++ b/.github/workflows/pull-request-workflow.yml @@ -16,7 +16,7 @@ jobs: - name: Setup Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '13.3.1' + xcode-version: '13.2.1' - name: Setup ruby and bundler dependencies uses: ruby/setup-ruby@v1.81.0 with: From 63a8ab4e1b395e3ef2334e3a9374cdad312e6362 Mon Sep 17 00:00:00 2001 From: Alberto De Bortoli Date: Sun, 15 May 2022 17:34:02 +0100 Subject: [PATCH 3/3] Update pull-request-workflow.yml --- .github/workflows/pull-request-workflow.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request-workflow.yml b/.github/workflows/pull-request-workflow.yml index d4a633a..78280f9 100644 --- a/.github/workflows/pull-request-workflow.yml +++ b/.github/workflows/pull-request-workflow.yml @@ -12,20 +12,27 @@ jobs: - name: Git checkout uses: actions/checkout@v2.3.4 with: + fetch-depth: 0 ref: ${{ github.ref }} - name: Setup Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '13.2.1' + xcode-version: latest-stable - name: Setup ruby and bundler dependencies uses: ruby/setup-ruby@v1.81.0 with: bundler-cache: true - name: Run pod install - run: bundle exec pod install --project-directory=Example + run: | + set -eo pipefail + export LIB_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`) + bundle exec pod install --project-directory=Example - name: Run tests (JustTweak) run: bundle exec fastlane unit_tests_just_tweak device:'iPhone 11' - name: Run tests (TweakAccessorGenerator) run: bundle exec fastlane unit_tests_tweak_accessor_generator - name: Validate lib - run: bundle exec pod lib lint --allow-warnings + run: | + set -eo pipefail + export LIB_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`) + bundle exec pod lib lint --allow-warnings