From b92214a52ebb1d66285428fb76372fc232a23b3d Mon Sep 17 00:00:00 2001 From: koromo <66541802+violet-dev@users.noreply.github.com> Date: Sat, 14 Oct 2023 14:11:15 +0900 Subject: [PATCH] ci: Add workflow for pr --- .github/workflows/pr.yml | 84 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 000000000..f7d46ecfb --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,84 @@ +name: Ci Pull Request +on: + pull_request: + branches: [ dev ] + workflow_dispatch: + merge_group: + +jobs: + ios-build: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + with: + ref: dev + - uses: subosito/flutter-action@v26 + with: + # flutter-version: '2.5.2' + channel: 'stable' + - uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: Preprocess + run: | + cd lib/server + wget -q ${{ secrets.SECRET_SALT }} + wget -q ${{ secrets.SECRET_WSALT }} + echo 'String getValid(String vToken) { return vToken; }' >> salt.dart + cp salt.dart wsalt.dart + cd ../.. + python3 preprocess-ios.py + - name: Podfile + run: | + cd ios + rm Podfile.lock + flutter clean + flutter pub get + pod install + pod update + cd .. + - name: Build + run: | + flutter build ios --release --no-codesign + mkdir -p Payload + mv ./build/ios/iphoneos/Runner.app Payload + zip -r -y Payload.zip Payload/Runner.app + mv Payload.zip Payload.ipa + - name: Upload IPA + uses: actions/upload-artifact@v2 + with: + name: ipa-build + path: Payload.ipa + + android-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: dev + - uses: actions/setup-java@v1 + with: + java-version: '12.x' + - uses: subosito/flutter-action@v1 + with: + # flutter-version: '2.5.2' + channel: 'stable' + - uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: Preprocess + run: | + cd lib/server + echo 'String getValid(String vToken) { return vToken; }' >> salt.dart + cp salt.dart wsalt.dart + cd ../.. + python3 preprocess-android.py + - name: Build + run: | + flutter clean + flutter build apk --release + - name: Upload APK + uses: actions/upload-artifact@v2 + with: + name: apk-build + path: ./build/app/outputs/apk/release/app-release.apk