This commit is contained in:
Gizzy
2024-12-20 13:12:39 +00:00
13 changed files with 553 additions and 100 deletions

View File

@@ -37,6 +37,15 @@ jobs:
- name: Build (arm64)
run: npm run build -- --arch arm64
- name: Download appimagelint and its deps
run: |
sudo apt install fuse -y
wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage
chmod +x appimagelint-x86_64.AppImage
- name: Check the appimage(s)
run: ./appimagelint-x86_64.AppImage dist/*.AppImage
- name: Upload Linux Artifacts
uses: actions/upload-artifact@v4
id: upload-artifact
@@ -56,78 +65,78 @@ jobs:
name: checksums
path: sha256sum.txt
# build-windows:
# name: Build bsky-desktop (Windows)
# runs-on: windows-latest
# env:
# ext: "exe"
# GITHUB_TOKEN: ${{ secrets.GHT }}
build-windows:
name: Build bsky-desktop (Windows)
runs-on: windows-latest
env:
ext: "exe"
GITHUB_TOKEN: ${{ secrets.GHT }}
# steps:
# - name: Checkout git repo
# uses: actions/checkout@v3
steps:
- name: Checkout git repo
uses: actions/checkout@v3
# - name: Setup node and npm
# uses: actions/setup-node@v3
# with:
# node-version: 16
- name: Setup node and npm
uses: actions/setup-node@v3
with:
node-version: 16
# - name: Install dependencies
# run: npm install
- name: Install dependencies
run: npm install
# - name: Build (x64)
# run: npm run build -- --arch x64
- name: Build (x64)
run: npm run build -- --arch x64
# - name: Build (arm64)
# run: npm run build -- --arch arm64
- name: Build (arm64)
run: npm run build -- --arch arm64
# - name: Upload Windows Artifacts
# uses: actions/upload-artifact@v4
# id: upload-artifact
# with:
# name: windows-artifacts
# path: |
# dist/*.exe
# dist/latest*.yml
- name: Upload Windows Artifacts
uses: actions/upload-artifact@v4
id: upload-artifact
with:
name: windows-artifacts
path: |
dist/*.exe
dist/latest*.yml
# build-macos:
# name: Build bsky-desktop (macOS)
# runs-on: macos-latest
# env:
# ext: "dmg"
# GITHUB_TOKEN: ${{ secrets.GHT }}
build-macos:
name: Build bsky-desktop (macOS)
runs-on: macos-latest
env:
ext: "dmg"
GITHUB_TOKEN: ${{ secrets.GHT }}
# steps:
# - name: Checkout git repo
# uses: actions/checkout@v3
steps:
- name: Checkout git repo
uses: actions/checkout@v3
# - name: Setup node and npm
# uses: actions/setup-node@v3
# with:
# node-version: 16
- name: Setup node and npm
uses: actions/setup-node@v3
with:
node-version: 16
# - name: Install dependencies
# run: npm install
- name: Install dependencies
run: npm install
# - name: Build (x64)
# run: npm run build -- --arch x64
- name: Build (x64)
run: npm run build -- --arch x64
# - name: Build (arm64)
# run: npm run build -- --arch arm64
- name: Build (arm64)
run: npm run build -- --arch arm64
# - name: Upload macOS Artifacts
# uses: actions/upload-artifact@v4
# id: upload-artifact
# with:
# name: macos-artifacts
# path: |
# dist/*.dmg
# dist/latest*.yml
- name: Upload macOS Artifacts
uses: actions/upload-artifact@v4
id: upload-artifact
with:
name: macos-artifacts
path: |
dist/*.dmg
dist/latest*.yml
release:
name: Create Release
runs-on: ubuntu-latest
needs: [build-linux]
needs: [build-linux, build-windows, build-macos]
outputs:
version_tag: ${{ steps.version.outputs.version }}
env:
@@ -147,17 +156,17 @@ jobs:
name: linux-artifacts
path: dist/linux
#- name: Download Windows Artifacts
# uses: actions/download-artifact@v4
# with:
# name: windows-artifacts
# path: dist/windows
- name: Download Windows Artifacts
uses: actions/download-artifact@v4
with:
name: windows-artifacts
path: dist/windows
#- name: Download macOS Artifacts
# uses: actions/download-artifact@v4
# with:
# name: macos-artifacts
# path: dist/macos
- name: Download macOS Artifacts
uses: actions/download-artifact@v4
with:
name: macos-artifacts
path: dist/macos
- name: Display structure of downloaded files
run: ls -R dist
@@ -165,7 +174,7 @@ jobs:
- name: Merge latest .ymls
uses: mikefarah/yq@v4.44.6
with:
cmd: yq ea '. as $item ireduce ({}; . * $item )' dist/*/*.yml > dist/combined.yml
cmd: yq eval-all '. as $item ireduce ({}; . * $item )' dist/*/*.yml > merged.yml
- name: Upload Release
id: create_release
@@ -176,9 +185,9 @@ jobs:
generate_release_notes: true
files: |
dist/linux/*.AppImage
# dist/windows/*.exe
# dist/macos/*.dmg
# dist/combined.yml
dist/windows/*.exe
dist/macos/*.dmg
merged.yml
aur:
name: Publish to AUR
@@ -191,31 +200,38 @@ jobs:
- name: Checkout git repo
uses: actions/checkout@v3
- name: Install jq
run: sudo apt-get update && sudo apt-get install jq -y
- name: Download checksums
uses: actions/download-artifact@v4
with:
name: checksums
path: ./sha256sum.txt
path: .
- name: List downloaded files
run: ls -R
- name: Show content of sha256sum.txt
run: cat sha256sum.txt
- name: Get app version
id: version
uses: pchynoweth/action-get-npm-version@1.1.1
- name: Extract checksum from sha256sum.txt and change build version
run: |
echo ${{ steps.version.outputs.version }}
new_checksum=$(awk 'NR==1 { print $1 }' ./sha256sum.txt)
sed -i "s|sha256sums=('SKIP' 'SKIP')|sha256sums=('$new_checksum' 'SKIP')|" ./build/PKGBUILD
sed -i "s/^pkgver=.*$/pkgver=${{ steps.version.outputs.version }}/" ./build/PKGBUILD
cat ./build/PKGBUILD
# - name: Publish AUR package
# if: false
# uses: KSXGitHub/github-actions-deploy-aur@3.0.1
# with:
# pkgname: bskydesktop
# pkgbuild: ./build/PKGBUILD
# commit_username: ${{ secrets.AUR_USERNAME }}
# commit_email: ${{ secrets.AUR_EMAIL }}
# ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
# commit_message: New Version
# ssh_keyscan_types: rsa,ecdsa,ed25519
- name: Publish AUR package
uses: KSXGitHub/github-actions-deploy-aur@v3.0.1
with:
pkgname: bskydesktop
pkgbuild: ./build/PKGBUILD
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: New Version
ssh_keyscan_types: rsa,ecdsa,ed25519

222
a.yml Normal file
View File

@@ -0,0 +1,222 @@
name: Build and Release bsky-desktop
on:
push:
branches: [$default-branch]
pull_request:
branches: [$default-branch]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-linux:
name: Build bsky-desktop (Linux)
runs-on: ubuntu-latest
env:
ext: "AppImage"
GITHUB_TOKEN: ${{ secrets.GHT }}
steps:
- name: Checkout git repo
uses: actions/checkout@v3
- name: Setup node and npm
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: npm install
- name: Build (x64)
run: npm run build -- --arch x64
- name: Build (arm64)
run: npm run build -- --arch arm64
- name: Upload Linux Artifacts
uses: actions/upload-artifact@v4
id: upload-artifact
with:
name: linux-artifacts
path: |
dist/*.AppImage
dist/latest*.yml
- name: Generate checksum
run: |
sha256sum dist/*.AppImage > sha256sum.txt
- name: Upload checksums
uses: actions/upload-artifact@v4
with:
name: checksums
path: sha256sum.txt
# build-windows:
# name: Build bsky-desktop (Windows)
# runs-on: windows-latest
# env:
# ext: "exe"
# GITHUB_TOKEN: ${{ secrets.GHT }}
# steps:
# - name: Checkout git repo
# uses: actions/checkout@v3
# - name: Setup node and npm
# uses: actions/setup-node@v3
# with:
# node-version: 16
# - name: Install dependencies
# run: npm install
# - name: Build (x64)
# run: npm run build -- --arch x64
# - name: Build (arm64)
# run: npm run build -- --arch arm64
# - name: Upload Windows Artifacts
# uses: actions/upload-artifact@v4
# id: upload-artifact
# with:
# name: windows-artifacts
# path: |
# dist/*.exe
# dist/latest*.yml
# build-macos:
# name: Build bsky-desktop (macOS)
# runs-on: macos-latest
# env:
# ext: "dmg"
# GITHUB_TOKEN: ${{ secrets.GHT }}
# steps:
# - name: Checkout git repo
# uses: actions/checkout@v3
# - name: Setup node and npm
# uses: actions/setup-node@v3
# with:
# node-version: 16
# - name: Install dependencies
# run: npm install
# - name: Build (x64)
# run: npm run build -- --arch x64
# - name: Build (arm64)
# run: npm run build -- --arch arm64
# - name: Upload macOS Artifacts
# uses: actions/upload-artifact@v4
# id: upload-artifact
# with:
# name: macos-artifacts
# path: |
# dist/*.dmg
# dist/latest*.yml
release:
name: Create Release
runs-on: ubuntu-latest
needs: [build-linux]
outputs:
version_tag: ${{ steps.version.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GHT }}
steps:
- name: Checkout git repo
uses: actions/checkout@v3
- name: Get app version
id: version
uses: pchynoweth/action-get-npm-version@1.1.1
- name: Download Linux Artifacts
uses: actions/download-artifact@v4
with:
name: linux-artifacts
path: dist/linux
#- name: Download Windows Artifacts
# uses: actions/download-artifact@v4
# with:
# name: windows-artifacts
# path: dist/windows
#- name: Download macOS Artifacts
# uses: actions/download-artifact@v4
# with:
# name: macos-artifacts
# path: dist/macos
- name: Display structure of downloaded files
run: ls -R dist
- name: Merge latest .ymls
uses: mikefarah/yq@v4.44.6
with:
cmd: yq ea '. as $item ireduce ({}; . * $item )' dist/*/*.yml > dist/combined.yml
- name: Upload Release
id: create_release
uses: softprops/action-gh-release@v2.1.0
with:
tag_name: "v${{ steps.version.outputs.version }}"
name: "bsky-desktop v${{ steps.version.outputs.version }}"
generate_release_notes: true
files: |
dist/linux/*.AppImage
# dist/windows/*.exe
# dist/macos/*.dmg
# dist/combined.yml
aur:
name: Publish to AUR
runs-on: ubuntu-latest
needs: release
env:
AUR_TOKEN: ${{ secrets.AUR_TOKEN }}
steps:
- name: Checkout git repo
uses: actions/checkout@v3
- name: Download checksums
uses: actions/download-artifact@v4
with:
name: checksums
path: ./sha256sum.txt
- name: Get app version
id: version
uses: pchynoweth/action-get-npm-version@1.1.1
- name: Extract checksum from sha256sum.txt and change build version
run: |
echo ${{ steps.version.outputs.version }}
new_checksum=$(awk 'NR==1 { print $1 }' ./sha256sum.txt)
sed -i "s|sha256sums=('SKIP' 'SKIP')|sha256sums=('$new_checksum' 'SKIP')|" ./build/PKGBUILD
sed -i "s/^pkgver=.*$/pkgver=${{ steps.version.outputs.version }}/" ./build/PKGBUILD
cat ./build/PKGBUILD
# - name: Publish AUR package
# if: false
# uses: KSXGitHub/github-actions-deploy-aur@3.0.1
# with:
# pkgname: bskydesktop
# pkgbuild: ./build/PKGBUILD
# commit_username: ${{ secrets.AUR_USERNAME }}
# commit_email: ${{ secrets.AUR_EMAIL }}
# ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
# commit_message: New Version
# ssh_keyscan_types: rsa,ecdsa,ed25519

View File

@@ -38,6 +38,10 @@
],
"artifactName": "bsky-desktop.${ext}",
"mac": {
"target": [
"dmg",
"pkg"
],
"icon": "src/ui/images/logo.icns",
"category": "Network"
},
@@ -45,7 +49,7 @@
"target": [
"appimage"
],
"icon": "src/ui/images/logo.png",
"icon": "src/ui/images/icons",
"category": "Network"
},
"win": {

View File

@@ -44,11 +44,11 @@ global.urls = {
// Settings urls:
global.settings = {
general: `${global.urls.main}/settings`,
account: `${global.urls.main}/settings/account`,
appearance: `${global.urls.main}/settings/appearance`,
privacy: `${global.urls.main}/settings/privacy-and-security`,
general: `${global.urls.main}/settings`
};
global.settings.account = `${global.settings.general}/account`;
global.settings.appearance = `${global.settings.general}/appearance`;
global.settings.privacy = `${global.settings.general}/privacy-and-security`;
// Badge options:
const badgeOptions = {

View File

@@ -79,33 +79,75 @@ function asarUpdate() {
}
function checkForUpdates() {
// Current system information
logger.log('Current system information:', sys.platform, sys.getVersion());
// Check if the current system is Windows
if (sys.isWin()) {
// Check if the system is before Windows 10
if (sys.laterThan('10.0.0')) {
// Check for updates, and if there are updates, download and install them
logger.log('Checking for updates (win)...');
} else {
if (sys.earlierThan('10.0.0')) {
// Windows 10 and above are supported, but windows 7 and 8 are not supported
logger.error('Windows 7 and 8 are not supported, please upgrade to Windows 10 or above, not updating...');
} else {
// Check for updates, and if there are updates, download and install them
logger.log('Checking for updates (win)...');
}
}
// Check if the current system is macOS
if (sys.isMac()) {
// Check if the current version is later than macOS 10.15.0
if (sys.laterThan('10.15.0')) {
// Check for updates, and if there are updates, download and install them
logger.log('Checking for updates (macOS)...');
let macArch = '';
// Check the current version of macOS, and whether we can use the pkg installer
if (sys.laterThan('10.0.0')) {
// Check if system is after macOS 10 (11, 12, etc.)
if (sys.laterThan('11.0.0')) {
// macOS 11 and above support ARM64, check if system is ARM64
logger.log('Checkking system architecture...');
if (sys.isARM64()) {
// System is ARM64 (mac-arm64)
macArch = 'arm64';
} else {
// macOS 10.15 and above are supported, but macOS 10.14 and below are not supported
logger.error('macOS 10.14 and below are not supported, please upgrade to macOS 10.15 or above, not updating...');
// System is Intel (mac-x64)
macArch = 'intel';
}
} else {
// macOS 10 is mostly Intel, but some versions are ARM64
macArch = 'intel';
}
// Check for updates, and if there are updates, download and install them
logger.log('Checking for updates (mac)...');
// Run the .pkg installer
const pkgPath = path.join(global.paths.updateDir, 'bsky-desktop.pkg');
const command = `sudo installer -pkg ${pkgPath} -target /`;
// Spawn a new shell
const shellProcess = spawn('sh', ['-c', command], {
stdio: 'inherit', // Pipe input/output to/from the shell
});
shellProcess.on('error', (err) => {
console.error('Failed to spawn shell:', err);
});
shellProcess.on('close', (code) => {
if (code === 0) {
console.log('Update installed successfully.');
} else {
console.error(`Shell process exited with code ${code}.`);
}
});
} else {
// macOS versions before 10 are not supported
logger.error('macOS versions before 10 are not supported, not updating...');
}
}
// Check if the current system is Linux
if (sys.isLinux()) {
// Check for updates, and if there are updates, download and install them (no system version check)
// Linux versions use AppImage, so we instead need to check for a new asar file so that the app can
// load the new asar instead of the packaged one (or even just delete the old appimage and download a new one)
logger.log('Checking for updates (linux)...');
asarUpdate();
}

View File

@@ -5,6 +5,7 @@ class SystemInfo {
constructor() {
this.platform = os.platform(); // 'win32', 'darwin', 'linux'
this.release = os.release(); // OS version
this.arch = os.arch(); // 'arm', 'arm64', 'x64', 'x86'
this.versionInfo = this._getVersionInfo(); // Parsed version
}
@@ -23,6 +24,26 @@ class SystemInfo {
return this.platform === 'linux';
}
// Check if current system architecture is ARM
isARM() {
return this.arch === 'arm';
}
// Check if current system architecture is ARM64
isARM64() {
return this.arch === 'arm64';
}
// Check if current system architecture is x64
isX64() {
return this.arch === 'x64';
}
// Check if current system architecture is x86
isX86() {
return this.arch === 'x86';
}
// Compare if current version is later than the given version
laterThan(compareVersion) {
const current = this.versionInfo;
@@ -35,6 +56,11 @@ class SystemInfo {
return false;
}
// Compare if current version is earlier than the given version
earlierThan(compareVersion) {
return !this.laterThan(compareVersion);
}
// Private: Parse version strings (e.g., "10.0.19045" -> [10, 0, 19045])
_parseVersion(version) {
return version.split('.').map((num) => parseInt(num, 10) || 0);
@@ -57,6 +83,11 @@ class SystemInfo {
return [0, 0, 0]; // Unknown system
}
}
// Get current version as a string (e.g., "10.15.7")
getVersion() {
return this.versionInfo.join('.');
}
}
module.exports = SystemInfo;
@@ -66,6 +97,6 @@ module.exports = SystemInfo;
//console.log(`Is Windows: ${sys.isWin()}`);
//console.log(`Is macOS: ${sys.isMac()}`);
//console.log(`Is Linux: ${sys.isLinux()}`);
//console.log(`Current Version Info: ${sys.versionInfo.join('.')}`);
//console.log(`Current Version Info: ${sys.getVersion()}`);
//console.log(`Later than 10.0.19044: ${sys.laterThan('10.0.19044')}`);
//console.log(`Later than 5.15.0 (Linux Kernel): ${sys.laterThan('5.15.0')}`);

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 939 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -374,6 +374,15 @@ const BskyExt = {
},
"regex": /discord\.com\/invite\/([a-zA-Z0-9_]+)/
},
"discord_profile": {
"name": "Discord",
"type": "social",
"icon": "fab fa-discord",
"brand": {
"color": "#7289DA",
},
"regex": /discord\.com\/users\/([a-zA-Z0-9_]+)/
},
"discord.gg": {
"name": "Discord",
"type": "messaging",
@@ -473,6 +482,33 @@ const BskyExt = {
},
"regex": /irc:\/\/([a-zA-Z0-9_]+)/
},
"itchio": {
"name": "Itch.io",
"type": "content",
"icon": "fab fa-itch-io",
"brand": {
"color": "#FA5C5C",
},
"regex": /([a-zA-Z0-9_]+)\.itch\.io/
},
"etsy_shop": {
"name": "Etsy",
"type": "content",
"icon": "fab fa-etsy",
"brand": {
"color": "#D5641C",
},
"regex": /etsy\.com\/shop\/([a-zA-Z0-9_]+)/
},
"etsy_user": {
"name": "Etsy",
"type": "content",
"icon": "fab fa-etsy",
"brand": {
"color": "#D5641C",
},
"regex": /([a-zA-Z0-9_]+)\.etsy\.com/
},
"email": {
"name": "Email",
"type": "messaging",
@@ -498,7 +534,43 @@ const BskyExt = {
"brand": {
"color": "#1DA1F2",
},
"regex": /twitter\.com\/([a-zA-Z0-9_]+)/
"regex": /(twitter\.com|x\.com)\/([a-zA-Z0-9_]+)\/?$/
},
"xbox": {
"name": "Xbox",
"type": "social",
"icon": "fab fa-xbox",
"brand": {
"color": "#107C10",
},
"regex": /xbox\.com\/([a-zA-Z0-9_]+)/
},
"playstation": {
"name": "PlayStation",
"type": "social",
"icon": "fab fa-playstation",
"brand": {
"color": "#003087",
},
"regex": /playstation\.com\/([a-zA-Z0-9_]+)/
},
"steam": {
"name": "Steam",
"type": "content",
"icon": "fab fa-steam",
"brand": {
"color": "#000000",
},
"regex": /steamcommunity\.com\/id\/([a-zA-Z0-9_]+)/
},
"tiktok": {
"name": "TikTok",
"type": "social",
"icon": "fab fa-tiktok",
"brand": {
"color": "#000000",
},
"regex": /tiktok\.com\/@([a-zA-Z0-9_]+)/
},
"instagram": {
"name": "Instagram",
@@ -729,6 +801,72 @@ const BskyExt = {
}
},
/**
* @constant {Object} linkStylesOverrides - Style overrides for specific link types
*/
linkStylesOverrides: {
"bluesky": {
"default": {
"color": "rgb(0, 133, 255)",
"background": "#0000",
"border": "#0000",
},
"hover": {
"color": "#fff",
"background": "#0000",
"border": "#0000"
}
},
"discord": {
"default": {
"color": "#FFFFFF",
"background": "#7289DA",
"border": "#7289DA",
},
"hover": {
"color": "#7289DA",
"background": "#FFFFFF",
"border": "#7289DA"
}
},
"linktree": {
"default": {
"color": "#FFFFFF",
"background": "#39e09b",
"border": "#39e09b",
},
"hover": {
"color": "#39e09b",
"background": "#FFFFFF",
"border": "#39e09b"
}
},
"carrd": {
"default": {
"color": "#FFFFFF",
"background": "#2C2F33",
"border": "#2C2F33",
},
"hover": {
"color": "#2C2F33",
"background": "#FFFFFF",
"border": "#2C2F33"
}
},
"dribbble": {
"default": {
"color": "#FFFFFF",
"background": "#EA4C89",
"border": "#EA4C89",
},
"hover": {
"color": "#EA4C89",
"background": "#FFFFFF",
"border": "#EA4C89"
}
},
},
/**
* @constant {Object} buttonStyles - The button styles for the supported messaging apps
*
@@ -1109,7 +1247,7 @@ const BskyExt = {
let header = bio.closest("[data-testid='profileView']");
// Get the profile header button group element
let buttonGroup = header.querySelector('[role="button"]').parentElement;
let buttonGroup = header.querySelector("div.css-175oi2r.r-2llsf > div:nth-child(1) > div > div:nth-child(2) > div.css-175oi2r.r-12vffkv");
// Check if the profile header button group element exists
if (!buttonGroup) {