-
-
Notifications
You must be signed in to change notification settings - Fork 2
84 lines (84 loc) · 2.95 KB
/
build-prerelease-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
77
78
79
80
81
82
83
84
name: build-prerelease-android
run-name: Building a prerelease version apk file
permissions:
contents: write
packages: write
deployments: write
issues: write
pull-requests: write
repository-projects: write
security-events: write
statuses: write
on:
push:
branches:
- build-prerelease
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:' # optional, change this to force refresh cache
architecture: x64
- name: 🐦 Setup Shorebird
uses: shorebirdtech/setup-shorebird@v0
- name: Create the Keystore
env:
KEYSTORE_B64: ${{ secrets.KEYSTORE_B64 }}
run: |
# import keystore from secrets
echo $KEYSTORE_B64 | base64 -d > $RUNNER_TEMP/keystore.jks
- name: Create key.properties
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASS }}
KEY_ALIAS: ${{ secrets.KEYSTORE_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASS }}
run: |
echo -e "storePassword=$KEYSTORE_PASSWORD\nkeyPassword=$KEY_PASSWORD\nkeyAlias=$KEY_ALIAS\nstoreFile=$RUNNER_TEMP/keystore.jks" > android/key.properties
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: 1.0.0
- name: 'Get next minor version'
id: semvers
uses: "WyriHaximus/github-action-next-semvers@v1"
with:
version: ${{ steps.previoustag.outputs.tag }}
- name: Update pubspec.yaml
uses: fjogeleit/yaml-update-action@main
with:
valueFile: 'pubspec.yaml'
propertyPath: 'version'
value: "${{ steps.semvers.outputs.patch }}"
commitChange: true
branch: 'build-prerelease'
labels: 'bump'
message: 'Bump version to ${{ steps.semvers.outputs.patch }} [no ci]'
createPR: true
description: 'Automatic version bump to ${{ steps.semvers.outputs.patch }} for prerelease build'
- run: flutter pub get
- run: flutter gen-l10n
- name: 🚀 Shorebird Release
run: shorebird release android --force --artifact apk '--' --dart-define=BVS="Prerelease ${{ steps.semvers.outputs.v_patch }} ShoreBird"
env:
SHOREBIRD_TOKEN: ${{ secrets.SHOREBIRD_TOKEN }}
- run: cp "build/app/outputs/apk/release/app-release.apk" "EduPage2-${{ steps.semvers.outputs.v_patch }}.apk"
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ steps.semvers.outputs.v_patch }}"
prerelease: false
title: "EduPage2 Beta ${{ steps.semvers.outputs.v_patch }}"
files: |
EduPage2-${{ steps.semvers.outputs.v_patch }}.apk