Merge pull request #813 from Materialious/update/1.7.10

Update/1.7.10
This commit is contained in:
Ward
2025-02-21 12:40:21 +13:00
committed by GitHub
12 changed files with 135 additions and 87 deletions
+67
View File
@@ -0,0 +1,67 @@
name: Update Flathub PR
on:
workflow_run:
workflows: ["Build desktop"]
types:
- completed
jobs:
flathub-create-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout the flathub/us.materialio.Materialious repository
uses: actions/checkout@v4
with:
repository: flathub/us.materialio.Materialious
token: ${{ secrets.FLATHUB_TOKEN }}
- name: Retrieve latest release version and assets
id: get_release
run: |
RELEASE_DATA=$(curl --silent "https://api.github.com/repos/Materialious/Materialious/releases/latest")
VERSION=$(echo $RELEASE_DATA | jq -r .tag_name)
X86_URL=$(echo $RELEASE_DATA | jq -r '.assets[] | select(.name | contains("linux-x64.zip")) | .browser_download_url')
AARCH64_URL=$(echo $RELEASE_DATA | jq -r '.assets[] | select(.name | contains("linux-arm64.zip")) | .browser_download_url')
echo "::set-output name=version::$VERSION"
echo "::set-output name=x86_url::$X86_URL"
echo "::set-output name=aarch64_url::$AARCH64_URL"
- name: Generate SHA256 checksum for x86_64 release
id: sha256_x86
run: |
CHECKSUM=$(curl -L ${{ steps.get_release.outputs.x86_url }} | sha256sum | awk '{ print $1 }')
echo "::set-output name=x86_64_sha256::$CHECKSUM"
- name: Generate SHA256 checksum for aarch64 release
id: sha256_arm
run: |
CHECKSUM=$(curl -L ${{ steps.get_release.outputs.aarch64_url }} | sha256sum | awk '{ print $1 }')
echo "::set-output name=aarch64_sha256::$CHECKSUM"
- name: Update manifest file with new version and checksums
run: |
MANIFEST_FILE="us.materialio.Materialious.yml"
yq eval -i ".version = \"${{ steps.get_release.outputs.version }}\"" $MANIFEST_FILE
yq eval -i ".modules[0].sources[0].url = \"${{ steps.get_release.outputs.x86_url }}\"" $MANIFEST_FILE
yq eval -i ".modules[0].sources[0].sha256 = \"${{ steps.sha256_x86.outputs.x86_64_sha256 }}\"" $MANIFEST_FILE
yq eval -i ".modules[0].sources[1].url = \"${{ steps.get_release.outputs.aarch64_url }}\"" $MANIFEST_FILE
yq eval -i ".modules[0].sources[1].sha256 = \"${{ steps.sha256_arm.outputs.aarch64_sha256 }}\"" $MANIFEST_FILE
- name: Create Release Branch
run: |
git checkout -b release-v${{ steps.get_release.outputs.version }}
git push --set-upstream origin release-v${{ steps.get_release.outputs.version }}
- name: Commit changes
run: |
git add us.materialio.Materialious.yml
git commit -m "Update manifest for v${{ steps.get_release.outputs.version }} release"
git push
- name: Create Pull Request
run: |
echo ${{ secrets.FLATHUB_TOKEN }} >> auth.txt
gh auth login --with-token < auth.txt
rm auth.txt
gh pr create --title "Release v${{ steps.get_release.outputs.version }}" --body "This is an automated PR for the v${{ steps.get_release.outputs.version }} release. This PR will be updated and merged once testing is complete." --repo flathub/us.materialio.Materialious
+8 -1
View File
@@ -23,10 +23,17 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract version from package.json
id: extract_version
run: |
VERSION=$(jq -r .version ./materialious/package.json)
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./materialious
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: wardpearce/materialious:latest
tags: |
wardpearce/materialious:latest
wardpearce/materialious:${{ steps.extract_version.outputs.version }}
+2 -2
View File
@@ -7,8 +7,8 @@ android {
applicationId "us.materialio.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 91
versionName "1.7.9"
versionCode 93
versionName "1.7.11"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
@@ -53,7 +53,11 @@
<content_attribute id="social-contacts">intense</content_attribute>
</content_rating>
<releases>
<release version="1.6.25" date="2025-1-03">
<release version="1.7.11" date="2025-2-21">
<url>https://github.com/Materialious/Materialious/releases/tag/1.7.11</url>
</release>
<release version="1.6.25" date="2025-1-03">
<url>https://github.com/Materialious/Materialious/releases/tag/1.6.25</url>
</release>
<release version="1.6.18" date="2024-10-26">
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "Materialious",
"version": "1.7.9",
"version": "1.7.11",
"description": "Modern material design for Invidious.",
"author": {
"name": "Ward Pearce",
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "materialious",
"version": "1.7.9",
"version": "1.7.10",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "materialious",
"version": "1.7.9",
"version": "1.7.10",
"dependencies": {
"@capacitor-community/electron": "^5.0.1",
"@capacitor/android": "^6.1.2",
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "materialious",
"version": "1.7.9",
"version": "1.7.11",
"private": true,
"scripts": {
"dev": "vite dev",
@@ -74,4 +74,4 @@
"vidstack": "^1.12.12",
"youtubei.js": "^12.2.0"
}
}
}
@@ -24,7 +24,6 @@
interfaceDisplayThumbnailAvatars,
interfaceForceCase,
interfaceLowBandwidthMode,
interfacePreviewVideoOnHoverStore,
interfaceRegionStore,
interfaceSearchHistoryEnabled,
interfaceSearchSuggestionsStore,
@@ -183,22 +182,6 @@
</nav>
</div>
<div class="field no-margin">
<nav class="no-padding">
<div class="max">
<div>{$_('layout.previewVideoOnHover')}</div>
</div>
<label class="switch">
<input
type="checkbox"
bind:checked={$interfacePreviewVideoOnHoverStore}
onclick={() => interfacePreviewVideoOnHoverStore.set(!$interfacePreviewVideoOnHoverStore)}
/>
<span></span>
</label>
</nav>
</div>
<div class="field no-margin">
<nav class="no-padding">
<div class="max">
@@ -12,7 +12,6 @@
playerAutoplayNextByDefaultStore,
playerDefaultLanguage,
playerListenByDefaultStore,
playerMiniPlayerStore,
playerProxyVideosStore,
playerSavePlaybackPositionStore,
playerTheatreModeByDefaultStore,
@@ -45,22 +44,6 @@
<i>arrow_drop_down</i>
</div>
<div class="field no-margin">
<nav class="no-padding">
<div class="max">
<div>{$_('layout.player.miniPlayer')}</div>
</div>
<label class="switch">
<input
type="checkbox"
bind:checked={$playerMiniPlayerStore}
onclick={() => playerMiniPlayerStore.set(!$playerMiniPlayerStore)}
/>
<span></span>
</label>
</nav>
</div>
<div class="field no-margin">
<nav class="no-padding">
<div class="max">
-12
View File
@@ -12,7 +12,6 @@ import {
interfaceDisplayThumbnailAvatars,
interfaceForceCase,
interfaceLowBandwidthMode,
interfacePreviewVideoOnHoverStore,
interfaceRegionStore,
interfaceSearchSuggestionsStore,
playerAlwaysLoopStore,
@@ -20,7 +19,6 @@ import {
playerAutoplayNextByDefaultStore,
playerDefaultLanguage,
playerListenByDefaultStore,
playerMiniPlayerStore,
playerProxyVideosStore,
playerSavePlaybackPositionStore,
playerTheatreModeByDefaultStore,
@@ -99,11 +97,6 @@ const persistedStores: { name: string, store: Writable<any>, type: 'string' | 'b
store: interfaceSearchSuggestionsStore,
type: 'boolean'
},
{
name: 'previewVideoOnHover',
store: interfacePreviewVideoOnHoverStore,
type: 'boolean'
},
{
name: 'sponsorBlock',
store: sponsorBlockStore,
@@ -134,11 +127,6 @@ const persistedStores: { name: string, store: Writable<any>, type: 'string' | 'b
store: deArrowThumbnailInstanceStore,
type: 'string'
},
{
name: 'playerMiniPlayer',
store: playerMiniPlayerStore,
type: 'boolean'
},
{
name: 'syncious',
store: synciousStore,
-2
View File
@@ -37,7 +37,6 @@ export const playerListenByDefaultStore = persisted('listenByDefault', false);
export const playerSavePlaybackPositionStore = persisted('savePlaybackPosition', true);
export const playerTheatreModeByDefaultStore = persisted('theatreModeByDefault', false);
export const playerAutoplayNextByDefaultStore = persisted('autoplayNextByDefault', false);
export const playerMiniPlayerStore = persisted('miniPlayer', true);
export const playerYouTubeJsFallback = persisted('youTubeJsFallback', true);
export const playerYouTubeJsAlways = persisted('youTubeJsAlways', false);
export const playerAndroidBgPlayer = persisted('androidBgPlayer', true);
@@ -58,7 +57,6 @@ export const synciousInstanceStore: Writable<string | null | undefined> = persis
export const interfaceRegionStore: Writable<string> = persisted('interfaceRegion', 'US');
export const interfaceSearchSuggestionsStore = persisted('searchSuggestions', true);
export const interfacePreviewVideoOnHoverStore = persisted('previewVideoOnHover', true);
export const interfaceForceCase: Writable<TitleCase> = persisted('forceCase', null);
export const interfaceAutoExpandComments: Writable<boolean> = persisted('autoExpandComments', true);
export const interfaceAutoExpandDesc: Writable<boolean> = persisted('autoExpandDesc', false);
+48 -30
View File
@@ -1,54 +1,72 @@
"""Small script for keeping versioning consistent for Materialious
"""
import json
import os
import re
from datetime import datetime
LATEST_VERSION = "1.7.11"
RELEASE_DATE = datetime.now().strftime("%Y-%-m-%d") # Format: YYYY-M-D
LATEST_VERSION = "1.7.9"
WORKING_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "materialious")
ROOT_PACKAGE = os.path.join(WORKING_DIR, "package.json")
ELECTRON_PACKAGE = os.path.join(WORKING_DIR, "electron", "package.json")
ANDROID_PACKAGE = os.path.join(WORKING_DIR, "android", "app", "build.gradle")
METAINFO_FILE = os.path.join(WORKING_DIR, "electron", "materialious.metainfo.xml")
def package_json_update_ver(location: str) -> None:
with open(location, "r") as f_:
package = json.loads(f_.read())
package = json.load(f_)
if package["version"] == LATEST_VERSION:
return
package["version"] = LATEST_VERSION
with open(location, "w") as f_:
f_.write(json.dumps(package, indent="\t"))
json.dump(package, f_, indent="\t")
def update_android_version() -> None:
with open(ANDROID_PACKAGE, "r") as f_:
contents = f_.read()
version_code_match = re.search(r"versionCode\s+(\d+)", contents)
version_name_match = re.search(r'versionName\s+"([^"]+)"', contents)
if version_code_match and version_name_match:
version_code = int(version_code_match.group(1)) + 1
contents = re.sub(r"versionCode\s+\d+", f"versionCode {version_code}", contents)
contents = re.sub(
r'versionName\s+"[^"]+"', f'versionName "{LATEST_VERSION}"', contents
)
with open(ANDROID_PACKAGE, "w") as f_:
f_.write(contents)
def update_metainfo_release() -> None:
with open(METAINFO_FILE, "r") as f_:
contents = f_.read()
# Check if the version already exists in the releases
if re.search(rf'<release version="{re.escape(LATEST_VERSION)}"', contents):
print(f"Release version {LATEST_VERSION} already exists.")
return
new_release = f"""
<release version="{LATEST_VERSION}" date="{RELEASE_DATE}">
<url>https://github.com/Materialious/Materialious/releases/tag/{LATEST_VERSION}</url>
</release>"""
# Insert the new release after the opening <releases> tag
updated_contents = re.sub(r"(<releases>\s*)", rf"\1{new_release}\n", contents)
with open(METAINFO_FILE, "w") as f_:
f_.write(updated_contents)
if __name__ == "__main__":
for location in (ROOT_PACKAGE, ELECTRON_PACKAGE):
package_json_update_ver(location)
with open(ANDROID_PACKAGE, "r") as f_:
contents = f_.read()
version_code_match = re.search(r"versionCode\s+(\d+)", contents)
version_name_match = re.search(r'versionName\s+"([^"]+)"', contents)
if version_code_match and version_name_match:
version_code = version_code_match.group(1)
version_name = version_name_match.group(1)
f_.close()
with open(ANDROID_PACKAGE, "w") as f_:
new_version_code = int(version_code) + 1
f_.write(
contents.replace(
f"versionCode {version_code}", f"versionCode {new_version_code}"
).replace(
f'versionName "{version_name}"',
f'versionName "{LATEST_VERSION}"',
)
)
update_android_version()
update_metainfo_release()