Skip to content

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #111

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #111

Workflow file for this run

name: Flutter Build
on: [ push ]
jobs:
build_ios:
runs-on: macos-11
env:
APP_ID: ${{ secrets.APP_ID_IOS }}
BANNER_ID: ${{ secrets.BANNER_ID_IOS }}
REWARDED_ID: ${{ secrets.REWARDED_ID_IOS }}
FULLSCREEN_ID: ${{ secrets.FULLSCREEN_ID_IOS }}
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
BUILD_NUMBER: 21${{ github.run_number }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
# stolen from github actions docs
- run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- run: sed -i .bak "s|ca-app-pub-3940256099942544~3347511713|$APP_ID|g" ios/Runner/Info.plist
- run: flutter pub get
- run: pod repo update
- run: flutter build ios --release --dart-define "ADS_ENABLED=true" --dart-define "BANNER_AD_ID=$BANNER_ID" --dart-define="REWARDED_AD_ID=$REWARDED_ID" --dart-define="INTERSTITIAL_AD_ID=$FULLSCREEN_ID" --build-number="$BUILD_NUMBER"
- run: mkdir Payload
- run: mv build/ios/iphoneos/Drinkr.app Payload/Drinkr.app
- run: zip -r drinkr-app-release.zip ./Payload
- run: mv drinkr-app-release.zip drinkr-app-release.ipa
- name: Upload result
uses: actions/upload-artifact@v2
with:
name: ios_build_artifact
path: drinkr-app-release.ipa
- name: Clean up keychain and provisioning profile
run: |
security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
rm ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.mobileprovision
build_android_no_ads:
runs-on: ubuntu-latest
env:
BUILD_NUMBER: 21${{ github.run_number }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
- run: flutter pub get
- run: flutter build apk --release --build-number="$BUILD_NUMBER"
- run: flutter build appbundle --release --build-number="$BUILD_NUMBER"
- run: mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/app-release-no-ads.apk
- run: mv build/app/outputs/bundle/release/app-release.aab build/app/outputs/bundle/release/app-release-no-ads.aab
- name: Upload result
uses: actions/upload-artifact@v2
with:
name: android_build_artifact_noad_apk
path: build/app/outputs/flutter-apk/app-release-no-ads.apk
- name: Upload result
uses: actions/upload-artifact@v2
with:
name: android_build_artifact_noad_appbundle
path: build/app/outputs/bundle/release/app-release-no-ads.aab
build_android:
runs-on: ubuntu-latest
env:
APP_ID: ${{ secrets.APP_ID_ANDROID }}
BANNER_ID: ${{ secrets.BANNER_ID_ANDROID }}
REWARDED_ID: ${{ secrets.REWARDED_ID_ANDROID }}
FULLSCREEN_ID: ${{ secrets.FULLSCREEN_ID_ANDROID }}
BUILD_NUMBER: 21${{ github.run_number }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
- run: sed -i "s|ca-app-pub-3940256099942544~3347511713|$APP_ID|g" android/app/src/main/AndroidManifest.xml
- run: sed -i "s|ca-app-pub-3940256099942544~3347511713|$APP_ID|g" android/app/src/main/res/values/strings.xml
- run: flutter pub get
- run: flutter build apk --release --dart-define "ADS_ENABLED=true" --dart-define "BANNER_AD_ID=$BANNER_ID" --dart-define="REWARDED_AD_ID=$REWARDED_ID" --dart-define="INTERSTITIAL_AD_ID=$FULLSCREEN_ID" --build-number="$BUILD_NUMBER"
- run: flutter build appbundle --release --dart-define "ADS_ENABLED=true" --dart-define "BANNER_AD_ID=$BANNER_ID" --dart-define="REWARDED_AD_ID=$REWARDED_ID" --dart-define="INTERSTITIAL_AD_ID=$FULLSCREEN_ID" --build-number="$BUILD_NUMBER"
- name: Upload result
uses: actions/upload-artifact@v2
with:
name: android_build_artifact_apk
path: build/app/outputs/flutter-apk/app-release.apk
- name: Upload result
uses: actions/upload-artifact@v2
with:
name: android_build_artifact_appbundle
path: build/app/outputs/bundle/release/app-release.aab
sign_android_appbundle:
runs-on: ubuntu-latest
needs: build_android
steps:
- name: Download results from build
uses: actions/download-artifact@v4.1.7
with:
name: android_build_artifact_appbundle
- run: zip --delete app-release.aab "META-INF/*"
- uses: r0adkll/sign-android-release@v1
name: Sign app APPBUNDLE
id: sign_appbundle
with:
releaseDirectory: .
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "30.0.2"
- uses: actions/upload-artifact@v2
with:
name: android_signed_appbundle
path: ${{steps.sign_appbundle.outputs.signedReleaseFile}}
sign_android_apk:
runs-on: ubuntu-latest
needs: build_android
steps:
- name: Download results from build
uses: actions/download-artifact@v4.1.7
with:
name: android_build_artifact_apk
- uses: r0adkll/sign-android-release@v1
name: Sign app APK
id: sign_appapk
with:
releaseDirectory: .
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "30.0.2"
- uses: actions/upload-artifact@v2
with:
name: android_signed_apk
path: ${{steps.sign_appapk.outputs.signedReleaseFile}}
upload_to_google_play:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/stable'
needs: sign_android_appbundle
steps:
- name: Download results from build
uses: actions/download-artifact@v4.1.7
with:
name: android_signed_appbundle
- run: mkdir whatsnew/
- run: echo "Multiple Improvements." > whatsnew/whatsnew-en-US
- run: echo "Verschiedene Verbesserungen." > whatsnew/whatsnew-de-DE
- uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: ${{ secrets.GOOGLE_PLAY_JSON }}
packageName: com.drinkr.android
releaseFile: "app-release.aab"
track: beta
inAppUpdatePriority: 2
whatsNewDirectory: whatsnew
upload_to_apple_testflight:
runs-on: macos-11
if: github.ref == 'refs/heads/stable'
needs: build_ios
steps:
- name: Download results from build
uses: actions/download-artifact@v4.1.7
with:
name: ios_build_artifact
- name: 'Upload app to TestFlight'
uses: apple-actions/upload-testflight-build@v1
with:
app-path: 'drinkr-app-release.ipa'
app-type: "ios"
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }}
upload_to_github_releases:
runs-on: ubuntu-latest
needs: [ sign_android_appbundle, sign_android_apk, build_android_no_ads, build_ios ]
steps:
- name: Download results from build appbundle
uses: actions/download-artifact@v4.1.7
with:
name: android_signed_appbundle
- name: Download results from build apk
uses: actions/download-artifact@v4.1.7
with:
name: android_signed_apk
- name: Download results from build ios
uses: actions/download-artifact@v4.1.7
with:
name: ios_build_artifact
- name: Download results from build apk
uses: actions/download-artifact@v4.1.7
with:
name: android_build_artifact_apk
- name: Download results from build noad apk
uses: actions/download-artifact@v4.1.7
with:
name: android_build_artifact_noad_apk
- name: Download results from build noad appbundle
uses: actions/download-artifact@v4.1.7
with:
name: android_build_artifact_noad_appbundle
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
automatic_release_tag: "latest"
files: |
*.aab
*.apk
*.ipa