forked from atsamd21/Haveno-app
-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (78 loc) · 3.14 KB
/
build-android.yml
File metadata and controls
91 lines (78 loc) · 3.14 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
name: Android Publish
on:
workflow_call:
inputs:
dotnet-version:
required: true
type: string
dotnet-version-target:
required: true
type: string
project-file:
required: true
type: string
project-folder:
required: true
type: string
build-config:
required: true
type: string
secrets:
keystore-password:
required: true
keystore-alias:
required: true
keystore:
required: true
jobs:
publish-android:
runs-on: windows-latest
name: Android Publish
steps:
- name: Setup .NET ${{ inputs.dotnet-version }}
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ inputs.dotnet-version }}
- uses: actions/checkout@v3
name: Checkout the code
- name: Install MAUI Workload
run: dotnet workload install maui --ignore-failed-sources
- name: Restore Dependencies
run: dotnet restore ${{ inputs.project-file }}
- name: Decode Keystore
id: decode_keystore
uses: timheuer/base64-to-file@v1
with:
fileDir: '${{ github.workspace }}\${{ inputs.project-folder }}'
fileName: 'havenoapp.keystore'
encodedString: ${{ secrets.keystore }}
- name: Change line endings to LF
run: |
$dirs = @(
"${{ inputs.project-folder }}\Platforms\Android\JniLibs\arm64-v8a",
"${{ inputs.project-folder }}\Platforms\Android\JniLibs\x86_64"
)
foreach ($dir in $dirs) {
$file = Join-Path $dir "libprootwrapper.so"
if (Test-Path $file) {
(Get-Content $file -Raw) -replace "`r`n","`n" | Set-Content $file -NoNewline
}
}
shell: pwsh
- name: Publish APK
run: dotnet publish ${{inputs.project-file}} -c ${{ inputs.build-config }} -f ${{ inputs.dotnet-version-target }}-android /p:AndroidPackageFormats=apk /p:AndroidKeyStore=true /p:AndroidSigningKeyStore=havenoapp.keystore /p:AndroidSigningKeyAlias=${{secrets.keystore-alias}} /p:AndroidSigningKeyPass="${{ secrets.keystore-password }}" /p:AndroidSigningStorePass="${{ secrets.keystore-password }}" /p:JavaMaximumHeapSize=4G --no-restore
- name: Rename APK
run: |
mv "${{ inputs.project-folder }}/bin/${{ inputs.build-config }}/${{ inputs.dotnet-version-target }}-android/publish/com.haveno-Signed.apk" "${{ inputs.project-folder }}/bin/${{ inputs.build-config }}/${{ inputs.dotnet-version-target }}-android/publish/haveno.apk"
shell: bash
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: android-apk
path: ${{ inputs.project-folder }}/bin/${{ inputs.build-config }}/${{ inputs.dotnet-version-target }}-android/publish/haveno.apk
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ inputs.project-folder }}/bin/${{ inputs.build-config }}/${{ inputs.dotnet-version-target }}-android/publish/haveno.apk