Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/YBTopaz8/Dimmer-MAUI
Browse files Browse the repository at this point in the history
  • Loading branch information
YBTopaz8 committed Jan 1, 2025
2 parents c231514 + 69ab0bc commit 61883a7
Show file tree
Hide file tree
Showing 5 changed files with 296 additions and 3 deletions.
142 changes: 142 additions & 0 deletions .github/workflows/dotnet-desktop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: Build and Release Dimmer

on:
release:
types: [published]
pull_request:
branches:
- main

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: Publish Windows Build
run: dotnet publish Dimmer-MAUI.csproj \
-f net9.0-windows10.0.19041.0 -c Release -r win-x64 \
--self-contained=false -p:WindowsPackageType=None \
-o ./windows-output

- name: Install Inno Setup
uses: jrsoftware/issrc-action@v1
with:
inno-setup-version: latest # or specify a version

- name: Package with Inno Setup
run: |
# Pass the Windows output directory as a define and explicitly set the output directory
ISCC.exe /dMySourceDir=./windows-output /o./Output ./releasePackaging/setup_dimmer.iss
- name: Verify Installer Exists
run: |
if [ ! -f "./Output/Setup_Dimmer.exe" ]; then
echo "Inno Setup did not create the installer file."
exit 1
else
echo "Installer file found: ./Output/Setup_Dimmer.exe"
fi
- name: Upload Windows Installer Artifact
uses: actions/upload-artifact@v3
with:
name: dimmer-windows-installer
path: ./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: Create a release notes file
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
142 changes: 142 additions & 0 deletions .github/workflows/release-dimmer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: Build and Release Dimmer

on:
release:
types: [published]
pull_request:
branches:
- main

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: Publish Windows Build
run: dotnet publish Dimmer-MAUI.csproj \
-f net9.0-windows10.0.19041.0 -c Release -r win-x64 \
--self-contained=false -p:WindowsPackageType=None \
-o ./windows-output

- name: Install Inno Setup
uses: jrsoftware/issrc-action@v1
with:
inno-setup-version: latest # or specify a version

- name: Package with Inno Setup
run: |
# Pass the Windows output directory as a define and explicitly set the output directory
ISCC.exe /dMySourceDir=./windows-output /o./Output ./releasePackaging/setup_dimmer.iss
- name: Verify Installer Exists
run: |
if [ ! -f "./Output/Setup_Dimmer.exe" ]; then
echo "Inno Setup did not create the installer file."
exit 1
else
echo "Installer file found: ./Output/Setup_Dimmer.exe"
fi
- name: Upload Windows Installer Artifact
uses: actions/upload-artifact@v3
with:
name: dimmer-windows-installer
path: ./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: Create a release notes file
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
9 changes: 9 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Test Workflow
on: push

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Echo a message
run: echo "Test workflow triggered!"
2 changes: 1 addition & 1 deletion Dimmer/ViewModels/ArtistsSection.HomePageVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public async Task ShowSpecificArtistsSongsWithAlbum(AlbumModelView album)
{
return;
}
await GetSongsFromAlbumId(album.LocalDeviceId);
await GetSongsFromAlbumId(album.LocalDeviceId!);
SelectedAlbumOnArtistPage.IsCurrentlySelected = true;

var song = AllArtistsAlbumSongs!.FirstOrDefault();
Expand Down
4 changes: 2 additions & 2 deletions Dimmer/Views/Desktop/CustomViews/DimmerWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ protected override void OnCreated()
this.Width = 1200;

#if DEBUG
DimmerTitleBar.Subtitle = "v1.0-debug";
DimmerTitleBar.Subtitle = "v0.9-debug";
DimmerTitleBar.BackgroundColor = Microsoft.Maui.Graphics.Colors.DarkRed;
#endif

#if RELEASE
DimmerTitleBar.Subtitle = "v1.0-release";
DimmerTitleBar.Subtitle = "v0.9-release";
#endif

StickTopImgBtn.IsVisible = HomepageVM.IsStickToTop;
Expand Down

0 comments on commit 61883a7

Please sign in to comment.