Skip to content

Commit

Permalink
Update CD.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
wwplr committed May 5, 2023
1 parent 5a9933c commit dcae8c6
Showing 1 changed file with 43 additions and 22 deletions.
65 changes: 43 additions & 22 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,55 @@ on:
push:
branches: [ "main" ]

permissions:
contents: write

jobs:
ios-build:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: RewardProcessing
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
- run: flutter --version
- run: flutter test

build-ios:
needs: test
runs-on: macos-latest
defaults:
run:
working-directory: RewardProcessing
steps:
- uses: actions/checkout@v2
- uses: subosito/[email protected]
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
channel: 'stable'
distribution: 'zulu'
java-version: '11'
- uses: subosito/flutter-action@v2
- run: flutter pub get
- run: flutter analyze
- run: flutter test
- run: |
flutter build ios --release --no-codesign
cd build/ios/iphoneos
mkdir Payload
cd Payload
mkdir Release
cd Release
ln -s ../Runner.app
cd ..
zip -r app.ipa Payload
- uses: ncipollo/release-action@v1
zip -r app.ipa Release
- uses: actions/upload-artifact@v3
with:
path: RewardProcessing/build/ios/iphoneos/app.ipa
- uses: softprops/action-gh-release@v1
with:
artifacts: "build/ios/iphoneos/app.ipa"
allowUpdates: "true"
tag: v1.0.${{ github.run_number }}
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: v1.0.${{ github.run_number }}
files: RewardProcessing/build/ios/iphoneos/app.ipa
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-android:
needs: test
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -46,13 +65,15 @@ jobs:
java-version: '11'
- uses: subosito/flutter-action@v2
- run: flutter pub get
- run: flutter pub cache repair
- run: flutter test
- run: flutter build apk
- run: flutter build appbundle
- uses: ncipollo/release-action@v1
- run: flutter build appbundle --release
- uses: actions/upload-artifact@v3
with:
artifacts: "build/app/outputs/flutter-apk/*.apk"
allowUpdates: "true"
tag: v1.0.${{ github.run_number }}
token: ${{ secrets.GITHUB_TOKEN }}
path: RewardProcessing/build/app/outputs/flutter-apk/app-release.apk
- uses: softprops/action-gh-release@v1
with:

tag_name: v1.0.${{ github.run_number }}
files: RewardProcessing/build/app/outputs/flutter-apk/app-release.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit dcae8c6

Please sign in to comment.