-
Notifications
You must be signed in to change notification settings - Fork 29
76 lines (69 loc) · 2.31 KB
/
release_apk.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: release apk
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
check-latest: true
- uses: subosito/flutter-action@v2
with:
channel: 'beta'
- name: Set up Flutter 3.24.2
run: |
FLUTTER_URL="https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.24.2-stable.tar.xz"
FLUTTER_DIR="$HOME/flutter"
mkdir -p $FLUTTER_DIR
curl -L $FLUTTER_URL -o /tmp/flutter.tar.xz
tar -xf /tmp/flutter.tar.xz -C $FLUTTER_DIR --strip-components=1
chmod +x $FLUTTER_DIR/bin/cache/dart-sdk/bin/dart
echo "$FLUTTER_DIR/bin" >> $GITHUB_PATH
- working-directory: ./open_earable
run: flutter pub get
- working-directory: ./open_earable
run: flutter analyze
- working-directory: ./open_earable
run: flutter build apk
- uses: actions/upload-artifact@v3
with:
name: release-apk
path: open_earable/build/app/outputs/apk/release/app-release.apk
release:
permissions: write-all
runs-on: ubuntu-latest
needs: build
steps:
- name: Download APK Artifact
uses: actions/download-artifact@v3
with:
name: release-apk
path: ${{ github.workspace }}/release-apk
- uses: benjlevesque/[email protected]
id: short-sha
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: false
prerelease: false
release_name: Release ${{ github.event.head_commit.message }}
tag_name: ${{ env.SHA }}
- name: Upload APK as Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/release-apk/app-release.apk
asset_name: app-release.apk
asset_content_type: application/vnd.android.package-archive