Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move and rename to new RC official plugin #96

Merged
merged 17 commits into from Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
243 changes: 243 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,243 @@
version: 2.1
orbs:
macos: circleci/macos@2.3.6
android: circleci/android@2.3.0
node: circleci/node@5.1.0
revenuecat: revenuecat/sdks-common-config@2.2.0

aliases:
base-mac-job: &base-mac-job
resource_class: macos.x86.medium.gen2
macos:
xcode: '14.3.0'
shell: /bin/bash --login -o pipefail

release-tags: &release-tags
filters:
tags:
ignore: /^.*-SNAPSHOT/
branches:
ignore: /.*/

release-branches: &release-branches
filters:
tags:
ignore: /.*/
branches:
only: /^release\/.*/

only-main-branch: &only-main-branch
filters:
tags:
ignore: /.*/
branches:
only: main

parameters:
action:
type: enum
enum: [build, upgrade-hybrid-common, bump]
default: build
version:
type: string
default: ''
automatic:
type: boolean
default: false

commands:

install-nvm:
steps:
- node/install:
install-yarn: true

yarn-dependencies-unix:
description: "Install yarn dependencies"
steps:
- install-nvm
- restore_cache:
key: v2-unix-dependencies-{{ checksum "package.json" }}
- run: yarn
- save_cache:
paths:
- node_modules
key: v2-unix-dependencies-{{ checksum "package.json" }}

yarn-dependencies-mac:
description: "Install yarn dependencies"
steps:
- install-nvm
- restore_cache:
key: v2-mac-dependencies-{{ checksum "package.json" }}
- run: yarn
- save_cache:
paths:
- node_modules
key: v2-mac-dependencies-{{ checksum "package.json" }}

install-sdkman:
description: Install SDKMAN
steps:
- run:
name: Installing SDKMAN
command: |
curl -s "https://get.sdkman.io?rcupdate=false" | bash
echo -e '\nsource "/home/circleci/.sdkman/bin/sdkman-init.sh"' >> $BASH_ENV
source $BASH_ENV
- run:
name: Setup Java environment
command: |
sdk env install
echo -e '\nexport JAVA_HOME="/home/circleci/.sdkman/candidates/java/current"' >> $BASH_ENV

copy-npm-rc:
steps:
- run:
name: Copy npmrc sample file to final location
command: cp .npmrc.SAMPLE .npmrc

jobs:
run-tests-ios:
<<: *base-mac-job
steps:
- checkout
- revenuecat/install-gem-mac-dependencies:
cache-version: v1
- yarn-dependencies-mac
- run: yarn build
- run: yarn verify:ios

run-tests-android:
executor:
name: android/android-machine
resource-class: large
tag: 2023.06.1
steps:
- checkout
- revenuecat/install-gem-unix-dependencies:
cache-version: v1
- yarn-dependencies-unix
- run: yarn build
- run: yarn verify:android

run-lint:
docker:
- image: cimg/ruby:3.1.2
steps:
- checkout
- yarn-dependencies-unix
- run: yarn build
- run: yarn lint

prepare-next-version:
description: "Creates a PR with the new snapshot version"
docker:
- image: cimg/ruby:3.1.2
steps:
- checkout
- revenuecat/install-gem-unix-dependencies:
cache-version: v1
- revenuecat/trust-github-key
- revenuecat/setup-git-credentials
- run:
name: Prepare next version
command: bundle exec fastlane prepare_next_version

make-release:
description: "Publishes the new version and creates a github release"
<<: *base-mac-job
steps:
- checkout
- revenuecat/install-gem-mac-dependencies:
cache-version: v1
- revenuecat/trust-github-key
- copy-npm-rc
- run:
name: release
command: bundle exec fastlane release

update-hybrid-common-versions:
description: "Creates a PR updating purchases-hybrid-common to latest release"
<<: *base-mac-job
steps:
- checkout
- revenuecat/install-gem-mac-dependencies:
cache-version: v1
- revenuecat/trust-github-key
- revenuecat/setup-git-credentials
- run:
name: Updating to next version of phc
command: |
bundle exec fastlane update_hybrid_common \
version:<< pipeline.parameters.version >> \
open_pr:true \
automatic_release:<< pipeline.parameters.automatic >>

workflows:
version: 2
build-test:
when:
not:
equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
jobs:
- run-tests-ios
- run-tests-android
- run-lint

deploy:
when:
not:
equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
jobs:
- run-tests-ios:
<<: *release-branches
- run-tests-android:
<<: *release-branches
- run-lint:
<<: *release-branches
- hold:
type: approval
requires:
- run-tests-ios
- run-tests-android
- run-lint
<<: *release-branches
- revenuecat/tag-current-branch:
requires:
- hold
<<: *release-branches
- make-release:
<<: *release-tags

danger:
jobs:
- revenuecat/danger

snapshot-bump:
when:
not:
equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
jobs:
- prepare-next-version:
<<: *only-main-branch

weekly-run-workflow:
when:
and:
- equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
- equal: [ "release-train", << pipeline.schedule.name >> ]
jobs:
- revenuecat/automatic-bump

manual-trigger-bump:
when:
equal: [ bump, << pipeline.parameters.action >> ]
jobs:
- revenuecat/automatic-bump

update-hybrid-common-versions:
when:
equal: [ upgrade-hybrid-common, << pipeline.parameters.action >> ]
jobs:
- update-hybrid-common-versions
1 change: 1 addition & 0 deletions .eslintignore
@@ -1,2 +1,3 @@
build
dist
example
1 change: 0 additions & 1 deletion .github/FUNDING.yml

This file was deleted.

87 changes: 0 additions & 87 deletions .github/workflows/build.yml

This file was deleted.