Try to fix GA #62
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 iOS IPA and Android APK workflow | ||
on: push | ||
jobs: | ||
secrets: inherit | ||
apk: | ||
name: Build Android APK | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'oracle' | ||
cache: gradle | ||
- name: Flutter action | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: "stable" | ||
- name: Build APK | ||
env: | ||
MSB_ANDROID_KEY_PROPERTIES: ${{ secrets.MSB_ANDROID_KEY_PROPERTIES }} | ||
MSB_ANDROID_KEYSTORE_JKS: ${{ secrets.MSB_ANDROID_KEYSTORE_JKS }} | ||
run: | | ||
echo $MSB_ANDROID_KEY_PROPERTIES | base64 --decode > android/key.properties | ||
echo $MSB_ANDROID_KEYSTORE_JKS | base64 --decode > android/app/msb_app.jks | ||
flutter build apk \ | ||
--dart-define=MSB_BOT_NAME=moe_sticker_bot \ | ||
--target-platform android-arm,android-arm64 | ||
mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/msb_app.apk | ||
- name: Upload a APK Artifact | ||
uses: actions/upload-artifact@v3.1.2 | ||
with: | ||
name: apk | ||
path: build/app/outputs/flutter-apk/msb_app.apk | ||
ipa: | ||
name: Build iOS IPA | ||
runs-on: macos-14 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Flutter action | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: "stable" | ||
- name: Build IPA | ||
run: | | ||
flutter build ios --no-codesign \ | ||
--dart-define=MSB_BOT_NAME=moe_sticker_bot | ||
sh scripts/strip_payload.sh build/ios/iphoneos/Runner.app | ||
cd build/ios/iphoneos/ | ||
mkdir Payload | ||
mv Runner.app Payload/Runner.app | ||
bsdtar -acvf msb_app.ipa.zip Payload | ||
mv msb_app.ipa.zip msb_app.ipa | ||
- name: Upload a IPA Artifact | ||
uses: actions/upload-artifact@v3.1.2 | ||
with: | ||
name: ipa | ||
path: build/ios/iphoneos/msb_app.ipa | ||
release: | ||
name: Release | ||
if: startsWith(github.ref, 'refs/tags/') | ||
needs: [ apk, ipa ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: release/ | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
generate_release_notes: true | ||
files: | | ||
release/*/* |