Skip to content

Commit c352eba

Browse files
Merge pull request #3 from ursci/github-actions
Adds Github Actions
2 parents af81427 + ba0da42 commit c352eba

File tree

3 files changed

+116
-0
lines changed

3 files changed

+116
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build for Android
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
# This job will run on ubuntu virtual machine
11+
runs-on: ubuntu-latest
12+
steps:
13+
14+
# Setup Java environment in order to build the Android app.
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-java@v1
17+
with:
18+
java-version: '12.x'
19+
20+
# Setup the flutter environment.
21+
- uses: subosito/flutter-action@v1
22+
with:
23+
channel: 'stable' # 'dev', 'alpha', default to: 'stable'
24+
# flutter-version: '1.17.5' # you can also specify exact version of flutter
25+
26+
# Get flutter dependencies.
27+
- name: Install dependencies
28+
run: flutter pub get
29+
30+
- name: Build apk
31+
run: flutter build apk --split-per-abi
32+
33+
- name: Build appbundle
34+
run: flutter build appbundle
35+
36+
# Upload generated apk to the artifacts.
37+
- uses: actions/upload-artifact@v1
38+
with:
39+
name: hikagefinder-apk
40+
path: 'build/app/outputs/flutter-apk/'
41+
42+
# Upload generated appbundle to the artifacts.
43+
- uses: actions/upload-artifact@v1
44+
with:
45+
name: blescanner-aab
46+
path: 'build/app/outputs/bundle/release/app-release.aab'

.github/workflows/build_ios.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build for iOS
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
# This job will run on ubuntu virtual machine
11+
runs-on: macos-latest
12+
steps:
13+
14+
# Setup Java environment in order to build the Android app.
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-java@v1
17+
with:
18+
java-version: '12.x'
19+
20+
# Setup the flutter environment.
21+
- uses: subosito/flutter-action@v1
22+
with:
23+
channel: 'stable' # 'dev', 'alpha', default to: 'stable'
24+
# flutter-version: '1.17.5' # you can also specify exact version of flutter
25+
26+
# Get flutter dependencies.
27+
- name: Install dependencies
28+
run: flutter pub get
29+
30+
- name: Build ios
31+
run: flutter build ios --release --no-codesign
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build for Android
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
build:
10+
# This job will run on ubuntu virtual machine
11+
runs-on: ubuntu-latest
12+
steps:
13+
14+
# Setup Java environment in order to build the Android app.
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-java@v1
17+
with:
18+
java-version: '12.x'
19+
20+
# Setup the flutter environment.
21+
- uses: subosito/flutter-action@v1
22+
with:
23+
channel: 'stable' # 'dev', 'alpha', default to: 'stable'
24+
# flutter-version: '1.17.5' # you can also specify exact version of flutter
25+
26+
# Get flutter dependencies.
27+
- name: Install dependencies
28+
run: flutter pub get
29+
30+
- name: Build apk
31+
run: flutter build apk --release
32+
33+
# Upload generated appbundle to the artifacts.
34+
- uses: ncipollo/release-action@v1
35+
with:
36+
artifacts: "build/app/outputs/flutter-apk/*-release.apk"
37+
replacesArtifacts: true
38+
allowUpdates: true
39+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)