Repository navigation
156 lines (136 loc) · 5.73 KB
/
Copy pathrelease.yml
File metadata and controls
156 lines (136 loc) · 5.73 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Build IzzySoft Release APK
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
attach_to_release:
description: 'Attach APK to a GitHub release (tag name, blank to skip)'
required: false
default: ''
jobs:
build:
name: Build Release IzzySoft on Ubuntu
runs-on: ubuntu-latest
environment: release-signing
permissions:
contents: write
env:
CONFIGURATION: 'Release IzzySoft'
# Deterministic build helpers (best-effort — full byte-for-byte reproducibility
# still requires audit of trimmer/AOT output and APK packaging order).
DOTNET_NOLOGO: 'true'
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # so we can derive SOURCE_DATE_EPOCH from the tag commit
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Install android workload
run: dotnet workload restore Seeker/Seeker.csproj
- name: Derive SOURCE_DATE_EPOCH from HEAD commit
run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> "$GITHUB_ENV"
- name: Decode keystore
env:
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
run: |
if [ -z "$ANDROID_KEYSTORE_BASE64" ]; then
echo "::error::ANDROID_KEYSTORE_BASE64 secret is not set"
exit 1
fi
mkdir -p "$RUNNER_TEMP/keystore"
echo "$ANDROID_KEYSTORE_BASE64" | base64 -d > "$RUNNER_TEMP/keystore/release.keystore"
echo "KEYSTORE_PATH=$RUNNER_TEMP/keystore/release.keystore" >> "$GITHUB_ENV"
- name: Restore
run: dotnet restore Seeker/Seeker.csproj
- name: Derive VERSION from tag
run: |
RAW="${{ github.event_name == 'workflow_dispatch' && inputs.attach_to_release || github.ref_name }}"
echo "VERSION=${RAW#v}" >> "$GITHUB_ENV"
- name: Build all-ABI release APKs
shell: pwsh
env:
ANDROID_KEYSTORE_PATH: ${{ env.KEYSTORE_PATH }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
run: ./Misc/package-release.ps1 -Version "$env:VERSION"
- name: List release APKs
run: ls -lh release-apks/
- name: Upload APK artifacts
uses: actions/upload-artifact@v4
with:
name: seeker-izzysoft-apks
path: release-apks/seeker*.apk
- name: Attach APKs to GitHub Release
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && inputs.attach_to_release != '')
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2.6.2
with:
tag_name: ${{ github.event_name == 'workflow_dispatch' && inputs.attach_to_release || github.ref_name }}
files: release-apks/seeker*.apk
fail_on_unmatched_files: true
generate_release_notes: true
make_latest: "true"
- name: Decode google-services.json
env:
GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }}
run: |
if [ -z "$GOOGLE_SERVICES_JSON_BASE64" ]; then
echo "::error::GOOGLE_SERVICES_JSON_BASE64 secret is not set — Play Store build requires Firebase config"
exit 1
fi
echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 -d > Seeker/google-services.json
if [ ! -s Seeker/google-services.json ]; then
echo "::error::Seeker/google-services.json is missing or empty after decode"
exit 1
fi
if ! grep -q '"project_info"' Seeker/google-services.json; then
echo "::error::Seeker/google-services.json does not look like a valid Firebase config (missing project_info)"
exit 1
fi
- name: Build Play Store AAB (Release)
env:
AndroidSigningKeyStore: ${{ env.KEYSTORE_PATH }}
AndroidSigningKeyAlias: ${{ secrets.ANDROID_KEY_ALIAS }}
AndroidSigningKeyPass: ${{ secrets.ANDROID_KEY_PASSWORD }}
AndroidSigningStorePass: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
run: |
TFM=$(dotnet msbuild Seeker/Seeker.csproj -getProperty:TargetFramework -v:q | tr -d '[:space:]')
echo "TFM=$TFM" >> "$GITHUB_ENV"
dotnet publish Seeker/Seeker.csproj \
-c Release \
-f "$TFM" \
-p:AndroidSigningKeyStore="$KEYSTORE_PATH" \
-p:AndroidSigningKeyAlias="$AndroidSigningKeyAlias" \
-p:AndroidSigningKeyPass="$AndroidSigningKeyPass" \
-p:AndroidSigningStorePass="$AndroidSigningStorePass" \
-p:ContinuousIntegrationBuild=true \
-p:Deterministic=true \
-p:SourceRevisionId=${{ github.sha }}
- name: Stage AAB for upload
run: |
AAB=$(find "Seeker/bin/Release/$TFM" -name "*-Signed.aab" -type f 2>/dev/null | head -n1)
if [ -z "$AAB" ]; then
echo "::error::No signed AAB found under Seeker/bin/Release/$TFM"
find Seeker/bin/Release -name "*.aab" -type f || true
exit 1
fi
mkdir -p release-aab
cp "$AAB" "release-aab/seeker${VERSION}.aab"
ls -lh release-aab/
- name: Upload AAB artifact
uses: actions/upload-artifact@v4
with:
name: seeker-playstore-aab
path: release-aab/seeker*.aab
if-no-files-found: error