build: update Fastlane #122
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
name: Build | |
on: | |
push: | |
env: | |
BUILD_OFFSET: 1000 | |
FASTLANE_SKIP_UPDATE_CHECK: 1 | |
FLUTTER_VERSION: '3.19.6' | |
JAVA_VERSION: '17.x' | |
jobs: | |
meta: | |
runs-on: ubuntu-latest | |
name: Set build metadata | |
outputs: | |
build_number: ${{ steps.meta.outputs.build_number }} | |
steps: | |
- id: meta | |
run: | | |
echo "::set-output name=build_number::$((${{ github.run_number }} + ${{ env.BUILD_OFFSET }}))" | |
build-ios: | |
runs-on: macos-latest | |
name: Build App for iOS | |
needs: | |
- meta | |
steps: | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: zulu | |
java-version: ${{ env.JAVA_VERSION }} | |
- uses: subosito/flutter-action@v1 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Build app (Flutter) | |
env: | |
BUILD_NUMBER: ${{ needs.meta.outputs.build_number }} | |
run: | | |
./build-ios.sh | |
- name: Build app (Xcode) | |
env: | |
APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }} | |
APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY }} | |
APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY_ID }} | |
MATCH_GIT_PRIVATE_KEY: ${{ secrets.CERTIFICATES_DEPLOY_KEY }} | |
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
MATCH_KEYCHAIN_PASSWORD: KeychainP4ssw0rd | |
MATCH_KEYCHAIN_NAME: ${{ runner.temp }}/flaska.keychain | |
run: | | |
security create-keychain -p $MATCH_KEYCHAIN_PASSWORD $MATCH_KEYCHAIN_NAME | |
security unlock-keychain -p $MATCH_KEYCHAIN_PASSWORD $MATCH_KEYCHAIN_NAME | |
security set-keychain-settings -lut 21600 $MATCH_KEYCHAIN_NAME | |
security default-keychain -d user -s $MATCH_KEYCHAIN_NAME | |
cd ios | |
bundle install | |
bundle exec fastlane build | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ios | |
path: | | |
ios/*.ipa | |
ios/*.dSYM.zip | |
retention-days: 14 | |
- name: Upload app | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release') | |
env: | |
APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }} | |
APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY }} | |
APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY_ID }} | |
run: | | |
cd ios | |
bundle exec fastlane upload | |
build-macos: | |
runs-on: macos-latest | |
name: Build App for macOS | |
needs: | |
- meta | |
steps: | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: zulu | |
java-version: ${{ env.JAVA_VERSION }} | |
- uses: subosito/flutter-action@v1 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Build app (Flutter) | |
env: | |
BUILD_NUMBER: ${{ needs.meta.outputs.build_number }} | |
run: | | |
./build-macos.sh | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: macos | |
path: | | |
build/macos/Build/Products/Release/*.zip | |
retention-days: 14 | |
build-android: | |
runs-on: ubuntu-latest | |
name: Build App for Android | |
needs: meta | |
steps: | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: zulu | |
java-version: ${{ env.JAVA_VERSION }} | |
- uses: subosito/flutter-action@v1 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Build app | |
env: | |
BUILD_NUMBER: ${{ needs.meta.outputs.build_number }} | |
ANDROID_KEY_JKS: ${{ secrets.ANDROID_KEY_JKS }} | |
ANDROID_KEY_PROPERTIES: ${{ secrets.ANDROID_KEY_PROPERTIES }} | |
run: | | |
./build-android.sh | |
cp build/app/outputs/bundle/release/*.aab android | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: android | |
path: android/*.aab | |
retention-days: 14 | |
- uses: ruby/setup-ruby@v1 | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release') | |
with: | |
ruby-version: 2.7 | |
bundler-cache: true | |
working-directory: android | |
- name: Upload app | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release') | |
env: | |
GOOGLE_API_KEY_JSON: ${{ secrets.GOOGLE_API_KEY_JSON }} | |
run: | | |
cd android | |
bundle exec fastlane upload |