Skip to content

restore versions after testing #87

restore versions after testing

restore versions after testing #87

name: Release production
on:
workflow_dispatch:
pull_request:
branches:
- main
types: [closed]
env:
BUILD_NUMBER: ${{ github.run_number }}
# Used by https://github.com/Microsoft/fastlane-plugin-appcenter
APPCENTER_API_TOKEN: ${{ secrets.APPCENTER_API_TOKEN }}
APPCENTER_OWNER_NAME: ${{ secrets.APPCENTER_OWNER_NAME }}
APPCENTER_OWNER_TYPE: ${{ secrets.APPCENTER_OWNER_TYPE }}
jobs:
release_prod_ios:
env:
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.FASTLANE_APP_PASSWORD }}
FASTLANE_USER: ${{ secrets.FASTLANE_USER }}
name: iOS (production)
environment: production
runs-on: macos-12
if:
github.event_name == 'workflow_dispatch' || (startsWith(github.head_ref, 'release/') && github.event.pull_request.merged ==
true)
steps:
- name: Notarize Release Build
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
- uses: actions/checkout@v3
- uses: nyaa8/package-version@v1
name: Fetch current version
- name: Create .env file
run: |
touch .env
echo NODE_ENV=production >> .env
echo REACT_NATIVE_APP_AUTH0_DOMAIN="${{ secrets.AUTH0_DOMAIN }}" >> .env
echo REACT_NATIVE_APP_AUTH0_AUDIENCE="${{ secrets.AUTH0_AUDIENCE }}" >> .env
echo REACT_NATIVE_APP_AUTH0_SCHEME="${{ secrets.AUTH0_SCHEME }}" >> .env
echo REACT_NATIVE_APP_AUTH0_CLIENT_ID="${{ secrets.AUTH0_CLIENT_ID }}" >> .env
echo REACT_NATIVE_APP_ENCRYPTION_KEY="${{ secrets.ENCRYPTION_KEY }}" >> .env
echo API_HOST="${{ secrets.API_HOST }}" >> .env
echo API_HOST_UITDATABANK="${{ secrets.API_HOST_UITDATABANK }}" >> .env
echo APP_NAME="${{ secrets.APP_NAME }}" >> .env
echo SENTRY_DSN="${{ secrets.SENTRY_DSN }}" >> .env
echo REACT_NATIVE_APP_VERSION_NR="${{ env.PACKAGE_VERSION }}" >> .env
cat .env
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Restore Pods cache
uses: actions/cache@v3
with:
path: |
ios/Pods
~/Library/Caches/CocoaPods
~/.cocoapods
key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install pods
run: cd ios && pod install
- run: fastlane ios_prod
release_prod_android:
name: Android (prod)
environment: production
runs-on: macos-12
if:
github.event_name == 'workflow_dispatch' || (startsWith(github.head_ref, 'release/') && github.event.pull_request.merged ==
true)
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.BRANCH }}
- uses: nyaa8/package-version@v1
name: Fetch current version
- name: Create .env file
run: |
touch .env
echo NODE_ENV=production >> .env
echo REACT_NATIVE_APP_AUTH0_DOMAIN="${{ secrets.AUTH0_DOMAIN }}" >> .env
echo REACT_NATIVE_APP_AUTH0_AUDIENCE="${{ secrets.AUTH0_AUDIENCE }}" >> .env
echo REACT_NATIVE_APP_AUTH0_SCHEME="${{ secrets.AUTH0_SCHEME }}" >> .env
echo REACT_NATIVE_APP_AUTH0_CLIENT_ID="${{ secrets.AUTH0_CLIENT_ID }}" >> .env
echo REACT_NATIVE_APP_ENCRYPTION_KEY="${{ secrets.ENCRYPTION_KEY }}" >> .env
echo API_HOST="${{ secrets.API_HOST }}" >> .env
echo API_HOST_UITDATABANK="${{ secrets.API_HOST_UITDATABANK }}" >> .env
echo APP_NAME="${{ secrets.APP_NAME }}" >> .env
echo SENTRY_DSN="${{ secrets.SENTRY_DSN }}" >> .env
echo REACT_NATIVE_APP_VERSION_NR="${{ env.PACKAGE_VERSION }}" >> .env
cat .env
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
cache: gradle
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Decode Service Account Key JSON File
uses: timheuer/base64-to-file@v1
id: service_account_json_file
with:
fileName: 'uitpas-store-api.json'
encodedString: ${{ secrets.GPLAY_SERVICE_ACCOUNT_KEY_JSON }}
- name: Decode Keystore File
uses: timheuer/base64-to-file@v1
id: android_keystore
with:
fileName: 'uitpas.keystore'
encodedString: ${{ secrets.STORE_FILE }}
- run: fastlane android_prod
env:
STORE_FILE: ${{ steps.android_keystore.outputs.filePath }}
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
ANDROID_JSON_KEY_FILE: ${{ steps.service_account_json_file.outputs.filePath }}
create_release:
name: Create release
needs: [release_prod_ios, release_prod_android]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.BRANCH }}
- uses: nyaa8/package-version@v1
name: Fetch current version
- name: Run latest-tag
uses: EndBug/latest-tag@latest
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.PACKAGE_VERSION }}