-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (76 loc) · 3.11 KB
/
Copy pathrelease.yml
File metadata and controls
89 lines (76 loc) · 3.11 KB
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
85
86
87
88
89
name: Release APK
on:
push:
tags:
- 'v*'
jobs:
build-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # need full history for release notes generation
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
- name: Decode keystore
env:
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
run: echo "$KEYSTORE_BASE64" | base64 --decode > app/hubble-quickstart.jks
- name: Decode google-services.json
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo "$GOOGLE_SERVICES_JSON" | base64 --decode > app/google-services.json
- name: Build release APK
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
HUBBLE_SDK_KEY: ${{ secrets.HUBBLE_SDK_KEY }}
run: |
# Create local.properties with SDK config for the build
echo "hubbleSdkKey=${HUBBLE_SDK_KEY}" > local.properties
./gradlew assembleRelease
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Rename artifacts
run: |
VERSION=${{ steps.version.outputs.VERSION }}
cp app/build/outputs/apk/release/app-release.apk \
app/build/outputs/apk/release/hubble-quickstart-${VERSION}.apk
if [ -f app/build/outputs/mapping/release/mapping.txt ]; then
cp app/build/outputs/mapping/release/mapping.txt \
app/build/outputs/mapping/release/mapping-${VERSION}.txt
fi
- name: Generate release notes
id: notes
run: |
PREV_TAG=$(git tag --sort=-creatordate | grep -v "^${GITHUB_REF_NAME}$" | head -1)
if [ -n "$PREV_TAG" ]; then
git log "${PREV_TAG}..HEAD" --pretty=format:"- %s" > release-notes.txt
else
echo "- Initial release" > release-notes.txt
fi
echo "Release notes:"
cat release-notes.txt
- name: Upload to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{ secrets.FIREBASE_APP_ID }}
serviceCredentialsFileContent: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_JSON }}
groups: internal-testers
file: app/build/outputs/apk/release/hubble-quickstart-${{ steps.version.outputs.VERSION }}.apk
releaseNotesFile: release-notes.txt
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
generate_release_notes: true
files: |
app/build/outputs/apk/release/hubble-quickstart-${{ steps.version.outputs.VERSION }}.apk
app/build/outputs/mapping/release/mapping-${{ steps.version.outputs.VERSION }}.txt
app/build/outputs/logs/manifest-merger-release-report.txt