Skip to content

update yml

update yml #777

Workflow file for this run

on:
push:
branches:
- master
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
KEYCHAIN_TOKEN: ${{ secrets.KEYCHAIN_TOKEN }}
APPSTORE_ISSUER_ID: ${{ secrets.APPSTORE_ISSUER_ID }}
APPSTORE_KEY_ID: ${{ secrets.APPSTORE_KEY_ID }}
name: Beta build & deploy
jobs:
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: "14.x"
- name: Create version tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |-
BUILD=$(git rev-list --count $GITHUB_SHA)
VERSION=$(node -e "p=require('./package.json');console.log(p.version)")
TAG_NAME="v${VERSION}.${BUILD}"
curl --request POST \
--url https://api.github.com/repos/moonlet/wallet-app/git/refs \
--header "authorization: token $GITHUB_TOKEN" \
--header "content-type: application/json" \
--data "{\"ref\": \"refs/tags/$TAG_NAME\",\"sha\": \"$GITHUB_SHA\"}"
- name: Cache node modules
uses: actions/cache@v1
id: cache
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
- name: Yarn install
run: yarn
- name: Generate icons
run: yarn run generate-icons
- name: Generate firebase web config file
run: |
echo '${{ secrets.FB_CONFIG_WEB_BETA }}' > src/config/firebase-web-beta.ts
echo '${{ secrets.FB_CONFIG_WEB_DEPLOY }}' > src/config/firebase-web-release.ts
- name: Run unit tests
run: yarn test
- name: Upload coverage to Codecov
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
run: |-
curl -s https://codecov.io/bash | bash -s -- \
-F "unittests" \
-Z || echo 'Codecov upload failed'
- name: Sentry release setup
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: moonlet
run: |-
BUILD=$(git rev-list --count $GITHUB_SHA)
VERSION=$(node -e "p=require('./package.json');console.log(p.version)")
npx sentry-cli releases new "com.moonlet.beta@$VERSION+$BUILD" -p wallet-app-android -p wallet-app-ios -p wallet-extension -p beta-app-android -p beta-app-ios -p beta-extension
npx sentry-cli releases set-commits "com.moonlet.beta@$VERSION+$BUILD" --auto
beta-android:
name: Android app
runs-on: ubuntu-latest
# needs: unit-tests
steps:
- name: Increase watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: "14.x"
- uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
- name: Generate firebase config file
run: |
echo '${{ secrets.FB_CONFIG_ANDROID_BETA }}' > android/app/google-services.json
echo '${{ secrets.FB_CONFIG_WEB_BETA }}' > src/config/firebase-web-beta.ts
echo '${{ secrets.FB_CONFIG_WEB_DEPLOY }}' > src/config/firebase-web-release.ts
- name: Setup key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_CERTS }}
- name: Add to host
run: ssh-keyscan gitlab.com >> ~/.ssh/known_hosts
- name: Dependencies install
run: cd android && bundle install
- name: Cache node modules
uses: actions/cache@v1
id: cache
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
- name: Yarn install
run: yarn
- name: Get sign ssh-keys
run: cd android/app && git clone [email protected]:moonlet/moonlet-playstore-key.git
- name: Generate fonts and icons
run: yarn run generate-icons
- name: Run fastlane beta
run: cd android/fastlane && bundle exec fastlane beta
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
APPCENTER_TOKEN: ${{ secrets.APPCENTER_TOKEN }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
NODE_OPTIONS: --max_old_space_size=4096
NODE_ENV: production
beta-ios:
name: iOS app
runs-on: macos-12
# needs: unit-tests
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup nodejs
uses: actions/setup-node@v3
with:
node-version: "14.x"
- name: Setup key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_CERTS }}
- name: Add to host
run: ssh-keyscan gitlab.com >> ~/.ssh/known_hosts
- name: Generate firebase config file
run: |
echo '${{ secrets.FB_CONFIG_IOS_BETA }}' > ios/GoogleService-Info.plist
echo '${{ secrets.FB_CONFIG_WEB_BETA }}' > src/config/firebase-web-beta.ts
echo '${{ secrets.FB_CONFIG_WEB_DEPLOY }}' > src/config/firebase-web-release.ts
- name: Generate p8 File
run: |
echo '${{ secrets.APPSTORE_CONNECT_FILE_KEY }}' > ios/AuthKey.p8
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.8
- name: Dependencies install
run: cd ios && bundle install
- name: Cache node modules
uses: actions/cache@v2
id: cache
with:
path: "**/node_modules"
key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock', 'package.json') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn
# - name: Cocoapods version
# run: gem install cocoapods -v '1.10.0.rc.1'
# - name: Sudo fix
# run: sudo gem install activesupport -v 7.0.8
# - name: Install xcversion
# run: |
# # gem install xcpretty
# gem install xcode-install
# # xcversion list
# shell: bash
# - name: Switch to the desired Xcode version
# run: |
# xcversion install 13.0 # Specify the desired Xcode version
# xcode-select -s /Applications/Xcode_13.0.app
# shell: bash
# - name: Install xcversion
# run: brew tap xcpretty/cask && brew install --cask xcversion
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn
- name: Cocoapods install
run: cd ios && pod install
- name: Generate fonts and icons
run: yarn run generate-icons
- name: Run fastlane beta
run: xcversion select 14.1 && cd ios/fastlane && bundle exec fastlane beta
env:
NODE_ENV: production