Skip to content

Commit cb31bc7

Browse files
committed
Added CI/CD
1 parent 40e63ba commit cb31bc7

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/build.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Run Build on app
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
name: Build App
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Cache Flutter Dependencies
14+
uses: actions/cache@v2
15+
with:
16+
path: |
17+
~/.pub-cache
18+
key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.yaml') }}
19+
20+
- name: Check Out Code
21+
uses: actions/checkout@v4
22+
23+
- name: Get Flutter Action
24+
uses: subosito/flutter-action@v2
25+
with:
26+
channel: stable
27+
cache: true
28+
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
29+
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
30+
pub-cache-key: "flutter-pub:os:-:channel:-:version:-:arch:-:hash:"
31+
pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
32+
33+
- name: Echo Flutter Versions
34+
run: |
35+
flutter --version
36+
dart --version
37+
38+
- name: Run Pub get
39+
run: flutter pub get
40+
41+
- name: Setup JDK 17
42+
uses: actions/setup-java@v2
43+
with:
44+
distribution: "temurin"
45+
java-version: "17"
46+
47+
- name: Run flutter build
48+
run: flutter build apk --release --split-per-abi
49+
50+
- name: Debug Build Path
51+
run: ls -l build/app/outputs/apk/release
52+
53+
- name: Create Release
54+
uses: ncipollo/release-action/@v1
55+
with:
56+
artifacts: "build/app/outputs/apk/release/*.apk"
57+
name: Wordy
58+
tag: v1.0.${{ github.run_number }}
59+
token: ${{ secrets.FLUTTER }}

0 commit comments

Comments
 (0)