Skip to content

Commit

Permalink
ci: upgrade pipeline, unify rubies, upgrade to react-native 0.72 (pol…
Browse files Browse the repository at this point in the history
…ito#487)

* ci: bump ios target sdk, enable macos github runners

* ci: try to break everything

* ci: try to break everything pt 2

* ci: try to unify ruby & co

* ci: move caching before npm install, bump action versions

* ci: upgrade ruby version

* ci: more ruby fixes

* ci: retry ruby fix

* ci: enforce pod install

* ci: react-native-permissions upgrade Podfile

---------

Co-authored-by: Mobile AppleDev <[email protected]>
  • Loading branch information
QcFe and polito-mobile authored May 14, 2024
1 parent de66bbd commit 98446ec
Show file tree
Hide file tree
Showing 33 changed files with 2,881 additions and 3,238 deletions.
56 changes: 31 additions & 25 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
push_to_playstore: ${{ steps.configure.outputs.push_to_playstore }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version from tag (new release)
Expand Down Expand Up @@ -119,8 +119,12 @@ jobs:
echo "CONFIGURED:"
cat $GITHUB_OUTPUT
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Cache node modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('./package-lock.json') }}
Expand All @@ -144,32 +148,30 @@ jobs:
KEYSTORE_PATH: './keystore.jks'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set .env
run:
echo "MAPBOX_TOKEN=${{ secrets.MAPBOX_TOKEN }}" >> .env
- name: Set local.properties
run:
echo "MAPBOX_DOWNLOADS_TOKEN=${{ secrets.MAPBOX_TOKEN }}" >> android/local.properties
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1
uses: gradle/actions/wrapper-validation@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
working-directory: ./android
ruby-version: '2.7.6'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version-file: .nvmrc
- name: Cache node modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('./package-lock.json') }}
- name: Cache Gradle artifacts
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
Expand Down Expand Up @@ -217,7 +219,6 @@ jobs:
build-ios:
name: ${{ needs.configure.outputs.push_to_testflight == 'false' && 'Build' || 'Build & Deploy' }} iOS
env:
ImageOS: macos12
LANG: en_US.UTF-8
CI: 'true'
BUILD_NO: ${{ needs.configure.outputs.build_no }}
Expand All @@ -229,44 +230,49 @@ jobs:
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.FASTLANE_APPLE_DEV_PW }}
SUPPLY_GOOGLE_SERVICE_INFO_PLIST_PATH: "./GoogleService-Info.plist"
needs: configure
runs-on: [self-hosted, macos-12]
runs-on: [macos-latest]
steps:
- name: Select Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '14'
xcode-version: '15'
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set .env
run:
echo "MAPBOX_TOKEN=${{ secrets.MAPBOX_TOKEN }}" >> .env
- name: Set .netrc
run: |
echo "machine api.mapbox.com
login mapbox
password ${{ secrets.MAPBOX_TOKEN }}
" > ~/.netrc
chmod 600 ~/.netrc
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
working-directory: ./ios
ruby-version: '2.7.6'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version-file: .nvmrc
- name: Cache node modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('./package-lock.json') }}
- name: Setup .npmrc
run: printf '@polito:registry=https://npm.pkg.github.com\n//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}\n' > .npmrc
- name: Install npm dependencies
run: npm install
- name: Cache pods
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
- name: Install pod dependencies
- name: Install npm dependencies
run: npm install
- name: Ensure pods installed
working-directory: ./ios
run: bundle exec pod install --repo-update
run: bundle exec pod install
- name: Prepare fastlane
working-directory: ./ios
run: |
Expand Down Expand Up @@ -301,7 +307,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Gather artifacts
uses: actions/download-artifact@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
name: "Code linting: ${{ matrix.check }}"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('./package-lock.json') }}
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.16.0
18.20.2
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.2.1
15 changes: 15 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
source "https://rubygems.org"

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby File.read(File.join(__dir__, '.ruby-version')).strip

gem 'fastlane'
install_if -> { RUBY_PLATFORM =~ /darwin/ } do
gem 'cocoapods', '~> 1.14', '>= 1.14.3'
end

plugins_path = File.join(File.dirname(__FILE__), 'ios', 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)

plugins_path = File.join(File.dirname(__FILE__), 'android', 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
Loading

0 comments on commit 98446ec

Please sign in to comment.