zil change node #741
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- master | |
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-11 | |
needs: unit-tests | |
steps: | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: "14.x" | |
- uses: actions/checkout@v1 | |
- 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: Dependencies install | |
run: cd ios && 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: Cocoapods install | |
run: cd ios && pod install | |
- name: Generate fonts and icons | |
run: yarn run generate-icons | |
- name: Run fastlane beta | |
run: xcversion select 13.0 && cd ios/fastlane && bundle exec fastlane beta | |
env: | |
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
# FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }} | |
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }} | |
# DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS: " " | |
# FASTLANE_SESSION: ${{ secrets.FASTLANE_SESSION }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
KEYCHAIN_TOKEN: ${{ secrets.KEYCHAIN_TOKEN }} | |
NODE_ENV: production | |
APPSTORE_ISSUER_ID: ${{ secrets.APPSTORE_ISSUER_ID }} | |
APPSTORE_KEY_ID: ${{ secrets.APPSTORE_KEY_ID }} |