Skip to content

Commit 35541a0

Browse files
author
Sagar Shende
committed
Workflow #6
1 parent 775ef15 commit 35541a0

File tree

1 file changed

+15
-71
lines changed

1 file changed

+15
-71
lines changed
Lines changed: 15 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
name: "Build & Release"
2-
31
on:
42
pull_request:
53
branches:
@@ -10,23 +8,23 @@ on:
108
- main
119
- master
1210
- develop
13-
11+
name: "Build & Release"
1412
jobs:
1513
build-android:
1614
name: Build and Release APK
1715
runs-on: ubuntu-latest
1816
steps:
19-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v1
2018

2119
- name: Setup Java
2220
uses: actions/setup-java@v1
2321
with:
2422
java-version: '12.x'
2523

2624
- name: Setup Flutter
27-
uses: subosito/flutter-action@v2
25+
uses: subosito/flutter-action@v1
2826
with:
29-
flutter-version: '2.x'
27+
channel: 'stable'
3028

3129
- name: Get Flutter Dependencies
3230
run: flutter pub get
@@ -35,6 +33,7 @@ jobs:
3533
run: flutter build apk --release --split-per-abi
3634

3735
- name: Upload APK
36+
if: success()
3837
uses: actions/upload-artifact@v2
3938
with:
4039
name: android-apk
@@ -44,78 +43,23 @@ jobs:
4443
name: Build and Release iOS
4544
runs-on: macos-latest
4645
steps:
47-
- uses: actions/checkout@v2
46+
- uses: actions/checkout@v1
4847

4948
- name: Setup Flutter
50-
uses: subosito/flutter-action@v2
49+
uses: subosito/flutter-action@v1
5150
with:
52-
flutter-version: '2.x'
53-
54-
- name: Get Flutter Dependencies
55-
run: flutter pub get
56-
57-
- name: Build iOS
58-
run: flutter build ios --release --no-codesign
59-
51+
channel: 'stable'
6052
- run: |
53+
flutter build ios --no-codesign
6154
cd build/ios/iphoneos
6255
mkdir Payload
63-
cp -r Runner.app Payload/
56+
cd Payload
57+
ln -s ../Runner.app
58+
cd ..
6459
zip -r app.ipa Payload
65-
66-
- name: Upload IPA
67-
uses: actions/upload-artifact@v2
68-
with:
69-
name: ios-ipa
70-
path: build/ios/iphoneos/*.ipa
71-
72-
create-release:
73-
needs: [build-android, build-ios]
74-
runs-on: ubuntu-latest
75-
steps:
76-
- uses: actions/checkout@v2
77-
78-
- name: Download Android APK Artifact
79-
uses: actions/download-artifact@v2
80-
with:
81-
name: android-apk
82-
path: ./artifacts/android
83-
84-
- name: Download iOS IPA Artifact
85-
uses: actions/download-artifact@v2
86-
with:
87-
name: ios-ipa
88-
path: ./artifacts/ios
89-
90-
- name: Create Release
91-
id: create_release
60+
- name: Push to Releases
9261
uses: ncipollo/release-action@v1
93-
env:
94-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9562
with:
63+
artifacts: "./artifacts/android/*,build/ios/iphoneos/app.ipa"
9664
tag: v1.0.${{ github.run_number }}
97-
release_name: Release ${{ github.run_number }}
98-
body: |
99-
Release of the Android and iOS apps.
100-
draft: false
101-
prerelease: false
102-
103-
- name: Upload Android APK to Release
104-
uses: actions/upload-release-asset@v1
105-
env:
106-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107-
with:
108-
upload_url: ${{ steps.create_release.outputs.upload_url }}
109-
asset_path: ./artifacts/android/*.apk
110-
asset_name: app-release.apk
111-
asset_content_type: application/vnd.android.package-archive
112-
113-
- name: Upload iOS IPA to Release
114-
uses: actions/upload-release-asset@v1
115-
env:
116-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117-
with:
118-
upload_url: ${{ steps.create_release.outputs.upload_url }}
119-
asset_path: ./artifacts/ios/*.ipa
120-
asset_name: app-release.ipa
121-
asset_content_type: application/octet-stream
65+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)