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..78280f9 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 @@ -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 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.