-
-
Notifications
You must be signed in to change notification settings - Fork 6
149 lines (122 loc) · 5.59 KB
/
release-dimmer.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
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
name: Build and Release Dimmer
on: push
jobs:
build-windows:
name: Build and Package Windows Installer
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0
- name: Install .NET MAUI Workload
run: |
dotnet workload install maui
dotnet workload install android
- name: Add Local NuGet Source
dotnet nuget add source $(pwd)/Dimmer/releasePacking --name local-release-packing
- name: Configure DevExpress NuGet Source
run: dotnet nuget add source ${{ secrets.DEVEXPRESS_FEED_URL }} -n DevExpress
- name: Restore NuGet Packages
run: dotnet restore ./Dimmer/Dimmer-MAUI.csproj
- name: Publish Windows Build
run: dotnet publish ./Dimmer/Dimmer-MAUI.csproj -f net9.0-windows10.0.19041.0 -c Release -r win-x64 --self-contained=false -p:WindowsPackageType=None -o ./Dimmer/windows-output --verbosity detailed
- name: Download and Install Inno Setup
run: |
$innoSetupUrl = "https://files.jrsoftware.org/is/innosetup-6.2.2.exe" # Update if newer version
$installerPath = "innosetup.exe"
Invoke-WebRequest -Uri $innoSetupUrl -OutFile $installerPath
Start-Process -Wait -FilePath $installerPath -ArgumentList "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART"
- name: Package with Inno Setup
run: ISCC.exe /dMySourceDir=windows-output /o Output ./Dimmer/releasePacking/setup_dimmer.iss
working-directory: Dimmer-MAUI/Dimmer
- name: Verify Installer Exists
run: |
if (Test-Path -Path "./Output/Setup_Dimmer.exe") {
Write-Host "Success: Installer file found at ./Output/Setup_Dimmer.exe"
} else {
Write-Host "Error: Inno Setup did not create the installer file at ./Output/Setup_Dimmer.exe"
exit 1
}
working-directory: Dimmer-MAUI/Dimmer
- name: Upload Windows Installer Artifact
uses: actions/upload-artifact@v3
with:
name: dimmer-windows-installer
path: Dimmer-MAUI/Dimmer/Output/Setup_Dimmer.exe
# build-android:
# name: Build Android APK
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Repository
# uses: actions/checkout@v3
# - name: Setup .NET
# uses: actions/setup-dotnet@v3
# with:
# dotnet-version: 9.0
# - name: Restore NuGet packages
# run: dotnet restore Dimmer-MAUI.csproj
# - name: Build Android APK
# run: dotnet publish Dimmer-MAUI.csproj -f net9.0-android -c Release /p:AndroidKeyStorePath=${{ secrets.KEYSTORE_PATH }} /p:AndroidKeyStorePassword=${{ secrets.KEYSTORE_PASSWORD }} /p:AndroidKeyAlias=${{ secrets.KEYSTORE_ALIAS }} /p:AndroidKeyPassword=${{ secrets.KEY_PASSWORD }} -o ./android-output
# - name: Sign APK (using apksigner)
# run: |
# apk_path=$(find ./android-output -name "*.apk")
# apksigner sign --ks ${{ secrets.KEYSTORE_PATH }} --ks-pass pass:"${{ secrets.KEYSTORE_PASSWORD }}" --key-pass pass:"${{ secrets.KEY_PASSWORD }}" --ks-key-alias "${{ secrets.KEYSTORE_ALIAS }}" --out ./android-output/Dimmer-Signed.apk $apk_path
# - name: Align APK
# run: |
# aligned_apk_path="./android-output/Dimmer-Aligned.apk"
# unsigned_apk_path=$(find ./android-output -name "*.apk" ! -name "*-Aligned.apk" ! -name "*-Signed.apk")
# zipalign -v 4 "$unsigned_apk_path" "$aligned_apk_path"
# - name: Upload Android APK Artifact
# uses: actions/upload-artifact@v3
# with:
# name: dimmer-android-apk
# path: ./android-output/Dimmer-Aligned.apk
release:
name: Create GitHub Release
needs: [build-windows] # Only needs the Windows build for now
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Download Windows Installer Artifact
uses: actions/download-artifact@v3
with:
name: dimmer-windows-installer
path: ./release-assets/windows
# - name: Download Android APK Artifact
# uses: actions/download-artifact@v3
# with:
# name: dimmer-android-apk
# path: ./release-assets/android
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.release.tag_name }}
release_name: ${{ github.event.release.name }}
body_path: .github/release-notes.md # Optional
draft: false
prerelease: ${{ github.event.release.prerelease }}
- name: Upload Windows Installer to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release-assets/windows/Setup_Dimmer.exe
asset_name: Setup_Dimmer.exe
asset_content_type: application/x-msdownload
# - name: Upload Android APK to Release
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./release-assets/android/Dimmer-Aligned.apk
# asset_name: Dimmer.apk
# asset_content_type: application/vnd.android.package-archive