Skip to content

Commit e5343fd

Browse files
committed
[NEW] Github Actions Release
1 parent 4bf6d5c commit e5343fd

File tree

2 files changed

+59
-4
lines changed

2 files changed

+59
-4
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Builds
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ master ]
66
pull_request:
7-
branches: [ main ]
7+
branches: [ master ]
88

99
permissions: read-all
1010

@@ -23,14 +23,14 @@ jobs:
2323
java-version: 11
2424
distribution: temurin
2525

26-
- name: Clone Flutter repository with master channel
26+
- name: Set up Flutter
2727
uses: subosito/flutter-action@v2
2828
with:
2929
flutter-version: '3.16.9'
3030
channel: 'stable'
3131
- run: flutter doctor -v
3232

33-
- name: Checkout gallery code
33+
- name: Checkout Code
3434
uses: actions/checkout@v4
3535
- run: flutter pub get
3636

.github/workflows/release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Test, Build and Release APK
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
name: Build APK
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
19+
steps:
20+
- name: Checkout Repository
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Java
24+
uses: actions/setup-java@v4
25+
with:
26+
distribution: 'temurin'
27+
java-version: '17.x'
28+
29+
- name: Set up Flutter
30+
uses: subosito/flutter-action@v2
31+
with:
32+
flutter-version: '3.16.9'
33+
channel: 'stable'
34+
35+
- name: Cache Gradle dependencies
36+
uses: actions/cache@v4
37+
with:
38+
path: ~/.gradle/caches
39+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
40+
restore-keys: |
41+
${{ runner.os }}-gradle-
42+
43+
- name: Get dependencies
44+
run: flutter pub get
45+
46+
- name: Build APK
47+
run: flutter build apk --release
48+
49+
- name: Create a Release APK
50+
uses: ncipollo/release-action@v1
51+
with:
52+
artifacts: "build/app/outputs/flutter-apk/*.apk"
53+
token: ${{ secrets.PERSONAL_TOKEN }}
54+
commit: main
55+
tag: v1.0.${{ github.run_number }}

0 commit comments

Comments
 (0)