Skip to content

Commit

Permalink
Merge pull request #203 from FriesI23/github-action-dev
Browse files Browse the repository at this point in the history
Add Windows Installer CI
  • Loading branch information
FriesI23 authored Dec 24, 2024
2 parents 021f786 + 7306bf3 commit 34ad0d9
Show file tree
Hide file tree
Showing 5 changed files with 149 additions and 6 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/app-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,27 @@ jobs:
artifacts: >
build/macos/Build/Products/Release/mhabit.dmg
token: ${{ secrets.APP_RELEASE_TOKEN }}

build-windows-msix:
name: "Build windows MSIX Installer"
needs:
- pre-build
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_flutter
- name: Exposed Certificate
shell: bash
run: echo "${{ secrets.APP_SIGN_KEY_PFX }}" | base64 --decode > windows/certificate/publish.pfx
- name: Build MSIX
run: .flutter\bin\dart run msix:create --architecture x64 --output-name mhabit_x64 --certificate-path windows\certificate\publish.pfx --certificate-password '${{ secrets.APP_SIGN_KEY_PFX_PASSWORD }}' --install-certificate false
- name: Released - Windows
uses: ncipollo/release-action@v1
with:
allowUpdates: true
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitPrereleaseDuringUpdate: true
artifacts: >
build/windows/x64/runner/Release/mhabit_x64.msix
token: ${{ secrets.APP_RELEASE_TOKEN }}
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,11 @@ coverage/html/
.fvm/versions/

# coverage
coverage/
coverage/

# key
*.key
*.jks
*.keystore
*.pfx
*.p12
59 changes: 54 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,59 @@ You can customize each habit with the following options:

| platform | build | publish | desc. |
| -------- | ----- | ------------------------------------------------ | ---------------------------------- |
| android || [Github][github-myapp] / [F-Droid][fdroid-myapp] | |
| ios || | |
| macos || [Github][github-myapp] | |
| windows | 🟨 | | unimplemented features: `reminder` |
| linux | 🟨 | | limit features: `reminder` |
| android || [Github][github-myapp] / [F-Droid][fdroid-myapp] | |
| ios || | |
| macos || [Github][github-myapp] | |
| windows | 🟨 | [Github][github-myapp] | unimplemented features: `reminder` |
| linux | 🟨 | | limit features: `reminder` |

### Note: Windows MSIX Insaller

On a first-time attempt to install this MSIX, following prompt may appear:

> This app package’s publisher certificate could not be verified.
> Contact your system administrator or the app developer to obtain
> a new app package with verified certificates.
> The root certificate and all immediate certificates of the signature
> in the app package must be verified (0x800B010A)
This is because the MSIX installation package provided in Github/Releases/Assets
is a self-signed version, corresponding certificate must be trusted
on each machine which attempt to install it.

Install certificate by following the steps below:

> See [**here**][msix-install-cert] for steps with screenshots.
1. Right click msix installer package, select **Properties**
2. Switch to **Digital Signatures** tab and click signer under **Embedded Signatures**
3. Click **Details**, In new window click **View Certificate**
4. In new window (Certificate), click **Install Certificate**
5. In **Certificate Import Wizard** window:
1. Select **Local Machine** and click **Next**
2. Select **Place all certificates in the following store**
3. Click **Browse** and select **Trusted Root Certification Authorities**
4. Click **Finish**.
6. Finally a dialog with "_The import was successful._" should be poped-up.

Or execute commands below:

```powershell
# run at administrator
$signature = Get-AuthenticodeSignature -FilePath "\path\to\your\mhabit.msix"
$certificate = $signature.SignerCertificate
Export-Certificate -Cert $certificate -FilePath ".\mhabit.crt"
Import-Certificate -FilePath ".\mhabit.crt" -CertStoreLocation Cert:\LocalMachine\Root
```

After operations above, this MSIX package should now be able to install successfully.

> Trusting self-signed certificate always carries some risks.
> Skipping signature verification to install via command below is also allowed:
>
> ```powershell
> Add-AppPackage -Path "\path\to\your\mhabit.msix" -AllowUnsigned
> ```
## Todo
Expand Down Expand Up @@ -183,3 +231,4 @@ limitations under the License.
[weblate-engage]: https://hosted.weblate.org/engage/mhabit/
[sqflite-ffi-linux]: https://pub.dev/packages/sqflite_common_ffi#linux
[flutter-linux]: https://docs.flutter.dev/get-started/install/linux/desktop#development-tools
[msix-install-cert]: https://www.advancedinstaller.com/install-test-certificate-from-msix.html
34 changes: 34 additions & 0 deletions windows/certificate/publish.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
-----BEGIN CERTIFICATE-----
MIIF0zCCA7sCFGI95x5io8MWUHta8O/RihtmIaWaMA0GCSqGSIb3DQEBCwUAMIGl
MQswCQYDVQQGEwJDTjERMA8GA1UECAwIWmhlSmlhbmcxETAPBgNVBAcMCEhhbmda
aG91MREwDwYDVQQKDAhGcmllc0kyMzEUMBIGA1UECwwLU2VsZi1TaWduZWQxIjAg
BgNVBAMMGWlvLmdpdGh1Yi5mcmllc2kyMy5taGFiaXQxIzAhBgkqhkiG9w0BCQEW
FEZyaWVzSTIzQG91dGxvb2suY29tMB4XDTI0MTIyMzEyMzIzNloXDTM0MTIyMTEy
MzIzNlowgaUxCzAJBgNVBAYTAkNOMREwDwYDVQQIDAhaaGVKaWFuZzERMA8GA1UE
BwwISGFuZ1pob3UxETAPBgNVBAoMCEZyaWVzSTIzMRQwEgYDVQQLDAtTZWxmLVNp
Z25lZDEiMCAGA1UEAwwZaW8uZ2l0aHViLmZyaWVzaTIzLm1oYWJpdDEjMCEGCSqG
SIb3DQEJARYURnJpZXNJMjNAb3V0bG9vay5jb20wggIiMA0GCSqGSIb3DQEBAQUA
A4ICDwAwggIKAoICAQDk76GTP/MdVBS6L/8jzFnhHeEmCAacLfe/TWw4ojwye7uj
wYCSJfZeGSWJDhuIelwFz/xtVpcA1TYW2/DEiZu3oFpY7D9e/KAD3r+zKS/CZAN7
j0mqvaWteDLiutZyqUkWD2rSA9lPFZQglQGr59J/j7ymDM3PvPrIeKuW5COTIg69
vix/iRuyqQDjJMmrrp2ruDitAX2qKT26OqU/AbI6vo8MZ04BVVRJpBVYgneRTwNL
79yyyVuaBMeG3lS6Y3HiIZ6I0N6LW0vd6UWcDpmXIlFTcnqjq2L2HhakwQ7Y8hVr
FblS+trYYiLqUYAL5y8iF6AtmRGoPZVKwbZFBMyuDKvx17erQoflUDqcFEMl1Ytm
/s00Iytp6iMO+QcSPLmi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ate/publish.csr
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
-----BEGIN CERTIFICATE REQUEST-----
MIIFDDCCAvQCAQAwgaUxCzAJBgNVBAYTAkNOMREwDwYDVQQIDAhaaGVKaWFuZzER
MA8GA1UEBwwISGFuZ1pob3UxETAPBgNVBAoMCEZyaWVzSTIzMRQwEgYDVQQLDAtT
ZWxmLVNpZ25lZDEiMCAGA1UEAwwZaW8uZ2l0aHViLmZyaWVzaTIzLm1oYWJpdDEj
MCEGCSqGSIb3DQEJARYURnJpZXNJMjNAb3V0bG9vay5jb20wggIiMA0GCSqGSIb3
DQEBAQUAA4ICDwAwggIKAoICAQDk76GTP/MdVBS6L/8jzFnhHeEmCAacLfe/TWw4
ojwye7ujwYCSJfZeGSWJDhuIelwFz/xtVpcA1TYW2/DEiZu3oFpY7D9e/KAD3r+z
KS/CZAN7j0mqvaWteDLiutZyqUkWD2rSA9lPFZQglQGr59J/j7ymDM3PvPrIeKuW
5COTIg69vix/iRuyqQDjJMmrrp2ruDitAX2qKT26OqU/AbI6vo8MZ04BVVRJpBVY
gneRTwNL79yyyVuaBMeG3lS6Y3HiIZ6I0N6LW0vd6UWcDpmXIlFTcnqjq2L2Hhak
wQ7Y8hVrFblS+trYYiLqUYAL5y8iF6AtmRGoPZVKwbZFBMyuDKvx17erQoflUDqc
FEMl1Ytm/s00Iytp6iMO+QcSPLmi0QJE3Oy2Rn7hfOaC6xo4DwwHr99OF3cOmi4S
mCFWusoNxKv48b5vjCThIl3x3KnHD183dDDZZzBjUNtCkhOzaPuPAkAtKI2Kyp5P
vURd4BYnGHhOca6Qd6zN+167kGuOjblCxEShgxoIeqYs2IWF3ZE+n8bZnHYVWKZC
K3odid4LJA/qXcsetcnmnliQ0xJiLHO5j65HmvS8onnmf9e+rt8k37xjsTxHLKv4
BBDQKI5j1jBM1DHAoAI/TVMXBDXGmOobx41tAGb2V6UCTFhEEAQ5ZgAZGNDv5SpZ
CBZnWwIDAQABoCEwHwYJKoZIhvcNAQkHMRIMEH1QaCspeGglcDlIV3dYQXkwDQYJ
KoZIhvcNAQELBQADggIBACrPcLKGxkkK5ItAxJLCDsln1i3XSN/u9JD10g/m7QRY
6wZtioJE6GSSiqzu1qKdEYTowDbZ87Voua9tQpKyjjb9B6F+Mq8+JTIT5PCNUylE
0zHSeQ99KsDDLgB0aSrA9OdUx2KzdM5dralckC6cc11iWeqaww2GRCAMxxDOJ8FS
VLkVAQt6OyL9sr0Wrwukqm8KJYlA5abPCVTw21pe3ND6rahxlaaaOFq90o3lPBmc
bK2FQBifYq5pSyw5t5RXvAvplY3wattIE7FHNuKWPEvc/9VRr042LS8+XNPhxa6+
nb1EVRglT946xlV+Zo/yMKB8W7Z3dA+udQoWZVb+L70pBM464hqESOLJ2PdB9VaX
HFZYEdEvK9OPIyyOuwXwIIFXGOGpmGHrZEBpnp/SW5+oOtC6A8LtuETXHYprqnrc
oBEhxQDaZS/iYtWu+whbff4MGuP80oLuvDj296lnVyWF53rrvtDpMm5r8J9+noIa
8Wc86rFdr3zbini5ChTtmQP00h0mG4s2cjtD/1jL5riiuP2yqg82Qvn74aoUC808
tXDKrmDwWAGp/H+wwbVdAIR/b5gFdiZlXipcxaQMqUvzxd8oxabFYFaZFp+yLJGl
CLJsz4dR2qxU/rX5qaySNlzyzqdYclWsWJUiki1t3oGGGVQWuVTlo3RLr32km9pq
-----END CERTIFICATE REQUEST-----

0 comments on commit 34ad0d9

Please sign in to comment.