mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-12-16 09:03:54 -05:00
feat(CI): build + upload flatpak to gh-pages in build-gui-release-binaries.yml (#688)
* fix(flatpak): remove unused net.unstoppableswap.gui.json
This is the same as o.e.a.json just with a different id,
is unused, and was clearly supposed to be a rename,
not a copy, in the referenced commit
Fixes: 517a4fa574
* refactor(CI): clean up build-gui-release-binaries.yml
* refactor(publish_flatpak): deslopify. NFC
* refactor(publish_flatpak): lift out .flatpakrepo & .flatpakref
Common bits at the top for convenience
* feat(CI): build + upload flatpak to gh-pages in build-gui-release-binaries.yml
This is equivalent to the current flatpak releases except it also has
the icon
This commit is contained in:
parent
1f2a0605bc
commit
111a5a3271
6 changed files with 114 additions and 178 deletions
2
.github/actions/set-monero-env/action.yml
vendored
2
.github/actions/set-monero-env/action.yml
vendored
|
|
@ -9,7 +9,7 @@ runs:
|
||||||
|
|
||||||
# GUI-specific Ubuntu dependencies
|
# GUI-specific Ubuntu dependencies
|
||||||
grep -q noble /etc/os-release && pin==2.44.0-2 || pin=
|
grep -q noble /etc/os-release && pin==2.44.0-2 || pin=
|
||||||
echo "DEPS_GUI_UBUNTU_SPECIFIC=libgtk-3-dev libappindicator3-dev librsvg2-dev" {libwebkit2gtk-4.1-0,libwebkit2gtk-4.1-dev,libjavascriptcoregtk-4.1-0,libjavascriptcoregtk-4.1-dev,gir1.2-javascriptcoregtk-4.1,gir1.2-webkit2-4.1}"$pin" >> $GITHUB_ENV
|
echo "DEPS_GUI_UBUNTU_SPECIFIC=flatpak-builder jq libgtk-3-dev libappindicator3-dev librsvg2-dev" {libwebkit2gtk-4.1-0,libwebkit2gtk-4.1-dev,libjavascriptcoregtk-4.1-0,libjavascriptcoregtk-4.1-dev,gir1.2-javascriptcoregtk-4.1,gir1.2-webkit2-4.1}"$pin" >> $GITHUB_ENV
|
||||||
|
|
||||||
# Build tooling (Linux)
|
# Build tooling (Linux)
|
||||||
echo "DEPS_BUILD_LINUX=autoconf nsis mingw-w64 build-essential pkg-config libtool ccache make cmake gcc g++ git curl lbzip2 gperf g++-mingw-w64-x86-64" >> $GITHUB_ENV
|
echo "DEPS_BUILD_LINUX=autoconf nsis mingw-w64 build-essential pkg-config libtool ccache make cmake gcc g++ git curl lbzip2 gperf g++-mingw-w64-x86-64" >> $GITHUB_ENV
|
||||||
|
|
|
||||||
63
.github/workflows/build-gui-release-binaries.yml
vendored
63
.github/workflows/build-gui-release-binaries.yml
vendored
|
|
@ -101,8 +101,7 @@ jobs:
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export GNUPGHOME="$(mktemp -d)"
|
export GNUPGHOME="$(umask 077; mktemp -d)"
|
||||||
chmod 700 "$GNUPGHOME"
|
|
||||||
|
|
||||||
# Allow loopback pinentry when passphrase is provided
|
# Allow loopback pinentry when passphrase is provided
|
||||||
echo "allow-loopback-pinentry" >> "$GNUPGHOME/gpg-agent.conf"
|
echo "allow-loopback-pinentry" >> "$GNUPGHOME/gpg-agent.conf"
|
||||||
|
|
@ -152,15 +151,53 @@ jobs:
|
||||||
# Find all .asc signature files we just created
|
# Find all .asc signature files we just created
|
||||||
find target/${{ matrix.target }}/release/bundle -type f -name "*.asc" -print0 | while IFS= read -r -d '' sig_file; do
|
find target/${{ matrix.target }}/release/bundle -type f -name "*.asc" -print0 | while IFS= read -r -d '' sig_file; do
|
||||||
echo "Uploading signature: $sig_file"
|
echo "Uploading signature: $sig_file"
|
||||||
# Get just the filename for the asset name
|
|
||||||
asset_name=$(basename "$sig_file")
|
|
||||||
|
|
||||||
gh release upload "${{ github.event.release.tag_name }}" \
|
gh release upload "${{ github.event.release.tag_name }}" \
|
||||||
"$sig_file" \
|
"$sig_file" \
|
||||||
--clobber
|
--clobber
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: upload to crabnebula release (not for previews)
|
- name: Upload flatpak release
|
||||||
|
if: ${{ github.event_name != 'pull_request' && !contains(github.ref_name, 'preview') && matrix.target == 'x86_64-unknown-linux-gnu' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euxo pipefail
|
||||||
|
|
||||||
|
deb=$(find "$PWD" -name *.deb -print -quit)
|
||||||
|
read -r sum _ < <(sha256sum "$deb")
|
||||||
|
jq --arg deb_url "file://$deb" --arg deb_sha256 "$sum" '
|
||||||
|
.modules[0].sources = [
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"url": $deb_url,
|
||||||
|
"sha256": $deb_sha256
|
||||||
|
}
|
||||||
|
]
|
||||||
|
' < flatpak/org.eigenwallet.app.json > target/manifest.json
|
||||||
|
|
||||||
|
outdir=target/flatpak-repo
|
||||||
|
flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
|
||||||
|
flatpak-builder build-dir --gpg-sign="$GPG_FPR" --user --install-deps-from=flathub --disable-rofiles-fuse --disable-updates --repo="$outdir" target/manifest.json
|
||||||
|
flatpak build-update-repo --gpg-sign="$GPG_FPR" --generate-static-deltas --prune "$outdir"
|
||||||
|
flatpak build-bundle --gpg-sign="$GPG_FPR" "$outdir" "$outdir/org.eigenwallet.app.flatpak" org.eigenwallet.app
|
||||||
|
|
||||||
|
ln flatpak/index.html flatpak/*.flatpakre* src-tauri/icons/icon.png README.md "$outdir/"
|
||||||
|
> "$outdir/.nojekyll"
|
||||||
|
|
||||||
|
IFS=/ read -r user repo <<< "$GITHUB_REPOSITORY"
|
||||||
|
sed -e "s|%Url%|https://$user.github.io/$repo|" \
|
||||||
|
-e "s|%Homepage%|https://github.com/$GITHUB_REPOSITORY|" \
|
||||||
|
-e "s|%GPGKey%|$(gpg --export "$GPG_FPR" | base64 -w0)|" \
|
||||||
|
-i "$outdir"/*.flatpakre*
|
||||||
|
|
||||||
|
git -C "$outdir" init
|
||||||
|
git -C "$outdir" add .
|
||||||
|
git -C "$outdir" config user.name "${{ secrets.BOTTY_NAME }}"
|
||||||
|
git -C "$outdir" config user.email ${{ secrets.BOTTY_EMAIL }}
|
||||||
|
git -C "$outdir" commit -m "Build Flatpak repository from $GITHUB_REF_NAME ($GITHUB_SHA)"
|
||||||
|
git fetch -f "$outdir" HEAD:gh-pages
|
||||||
|
git push -f origin gh-pages
|
||||||
|
|
||||||
|
- name: Upload to crabnebula release (not for previews)
|
||||||
if: ${{ github.event_name != 'pull_request' && !contains(github.ref_name, 'preview') }}
|
if: ${{ github.event_name != 'pull_request' && !contains(github.ref_name, 'preview') }}
|
||||||
uses: crabnebula-dev/cloud-release@v0
|
uses: crabnebula-dev/cloud-release@v0
|
||||||
with:
|
with:
|
||||||
|
|
@ -186,8 +223,8 @@ jobs:
|
||||||
gh release download "$VERSION" --pattern "*.dmg" --dir /tmp/dmgs
|
gh release download "$VERSION" --pattern "*.dmg" --dir /tmp/dmgs
|
||||||
|
|
||||||
# Calculate SHA256 checksums
|
# Calculate SHA256 checksums
|
||||||
AARCH64_DMG=$(ls /tmp/dmgs/*_aarch64_darwin.dmg)
|
AARCH64_DMG=/tmp/dmgs/*_aarch64_darwin.dmg
|
||||||
X64_DMG=$(ls /tmp/dmgs/*_x64_darwin.dmg)
|
X64_DMG=/tmp/dmgs/*_x64_darwin.dmg
|
||||||
|
|
||||||
AARCH64_SHA256=$(sha256sum "$AARCH64_DMG" | awk '{print $1}')
|
AARCH64_SHA256=$(sha256sum "$AARCH64_DMG" | awk '{print $1}')
|
||||||
X64_SHA256=$(sha256sum "$X64_DMG" | awk '{print $1}')
|
X64_SHA256=$(sha256sum "$X64_DMG" | awk '{print $1}')
|
||||||
|
|
@ -196,12 +233,10 @@ jobs:
|
||||||
echo "x64 SHA256: $X64_SHA256"
|
echo "x64 SHA256: $X64_SHA256"
|
||||||
|
|
||||||
# Generate the Homebrew formula from template
|
# Generate the Homebrew formula from template
|
||||||
cp dev-scripts/homebrew/eigenwallet.rb.template eigenwallet.rb
|
sed -e "s/VERSION_PLACEHOLDER/$VERSION/g" \
|
||||||
sed -i "s/VERSION_PLACEHOLDER/$VERSION/g" eigenwallet.rb
|
-e "s/AARCH64_SHA256_PLACEHOLDER/$AARCH64_SHA256/g" \
|
||||||
sed -i "s/AARCH64_SHA256_PLACEHOLDER/$AARCH64_SHA256/g" eigenwallet.rb
|
-e "s/X64_SHA256_PLACEHOLDER/$X64_SHA256/g" \
|
||||||
sed -i "s/X64_SHA256_PLACEHOLDER/$X64_SHA256/g" eigenwallet.rb
|
dev-scripts/homebrew/eigenwallet.rb.template | tee eigenwallet.rb
|
||||||
|
|
||||||
cat eigenwallet.rb
|
|
||||||
|
|
||||||
- name: Upload Homebrew formula to release
|
- name: Upload Homebrew formula to release
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ BRANCH="gh-pages"
|
||||||
GPG_SIGN=""
|
GPG_SIGN=""
|
||||||
NO_GPG_FLAG=""
|
NO_GPG_FLAG=""
|
||||||
REPO_DIR="flatpak-repo"
|
REPO_DIR="flatpak-repo"
|
||||||
TEMP_DIR="$(mktemp -d)"
|
|
||||||
|
|
||||||
# Parse arguments
|
# Parse arguments
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
|
|
@ -39,13 +38,11 @@ done
|
||||||
# Function to list available GPG keys
|
# Function to list available GPG keys
|
||||||
list_gpg_keys() {
|
list_gpg_keys() {
|
||||||
echo "📋 Available GPG keys:"
|
echo "📋 Available GPG keys:"
|
||||||
gpg --list-secret-keys --keyid-format=long 2>/dev/null | grep -E "^(sec|uid)" | while IFS= read -r line; do
|
gpg --list-secret-keys --keyid-format=long 2>/dev/null | while read -r type key_info name; do
|
||||||
if [[ $line =~ ^sec ]]; then
|
if [[ $type = sec ]]; then
|
||||||
key_info=$(echo "$line" | awk '{print $2}')
|
|
||||||
echo " 🔑 Key: $key_info"
|
echo " 🔑 Key: $key_info"
|
||||||
elif [[ $line =~ ^uid ]]; then
|
elif [[ $type = uid ]]; then
|
||||||
uid=$(echo "$line" | sed 's/uid[[:space:]]*\[[^]]*\][[:space:]]*//')
|
echo " 👤 $name"
|
||||||
echo " 👤 $uid"
|
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
@ -58,7 +55,7 @@ select_gpg_key() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local keys=($(gpg --list-secret-keys --keyid-format=long 2>/dev/null | grep "^sec" | awk '{print $2}' | cut -d'/' -f2))
|
local keys=($(gpg --list-secret-keys --keyid-format=long 2>/dev/null | awk -F "[$IFS/]*" '/^sec/ {print $3}'))
|
||||||
|
|
||||||
if [ ${#keys[@]} -eq 0 ]; then
|
if [ ${#keys[@]} -eq 0 ]; then
|
||||||
echo "🔑 No GPG keys found."
|
echo "🔑 No GPG keys found."
|
||||||
|
|
@ -70,7 +67,6 @@ select_gpg_key() {
|
||||||
select_gpg_key
|
select_gpg_key
|
||||||
else
|
else
|
||||||
echo "⚠️ Proceeding without GPG signing (not recommended for production)"
|
echo "⚠️ Proceeding without GPG signing (not recommended for production)"
|
||||||
GPG_SIGN=""
|
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|
@ -80,7 +76,7 @@ select_gpg_key() {
|
||||||
echo "Please select a GPG key for signing:"
|
echo "Please select a GPG key for signing:"
|
||||||
for i in "${!keys[@]}"; do
|
for i in "${!keys[@]}"; do
|
||||||
local key_id="${keys[i]}"
|
local key_id="${keys[i]}"
|
||||||
local user_info=$(gpg --list-secret-keys --keyid-format=long "$key_id" 2>/dev/null | grep "^uid" | head -1 | sed 's/uid[[:space:]]*\[[^]]*\][[:space:]]*//')
|
local user_info=$(gpg --list-secret-keys --keyid-format=long "$key_id" 2>/dev/null | awk '/^uid/ {$1=""; $2="\b"; print; exit}')
|
||||||
echo " $((i+1))) ${key_id} - ${user_info}"
|
echo " $((i+1))) ${key_id} - ${user_info}"
|
||||||
done
|
done
|
||||||
echo " $((${#keys[@]}+1))) Skip GPG signing"
|
echo " $((${#keys[@]}+1))) Skip GPG signing"
|
||||||
|
|
@ -93,7 +89,6 @@ select_gpg_key() {
|
||||||
if [[ $choice =~ ^[0-9]+$ ]] && [ $choice -ge 1 ] && [ $choice -le $((${#keys[@]}+2)) ]; then
|
if [[ $choice =~ ^[0-9]+$ ]] && [ $choice -ge 1 ] && [ $choice -le $((${#keys[@]}+2)) ]; then
|
||||||
if [ $choice -eq $((${#keys[@]}+1)) ]; then
|
if [ $choice -eq $((${#keys[@]}+1)) ]; then
|
||||||
echo "⚠️ Proceeding without GPG signing"
|
echo "⚠️ Proceeding without GPG signing"
|
||||||
GPG_SIGN=""
|
|
||||||
break
|
break
|
||||||
elif [ $choice -eq $((${#keys[@]}+2)) ]; then
|
elif [ $choice -eq $((${#keys[@]}+2)) ]; then
|
||||||
import_gpg_key
|
import_gpg_key
|
||||||
|
|
@ -101,7 +96,7 @@ select_gpg_key() {
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
GPG_SIGN="${keys[$((choice-1))]}"
|
GPG_SIGN="${keys[$((choice-1))]}"
|
||||||
local selected_user=$(gpg --list-secret-keys --keyid-format=long "$GPG_SIGN" 2>/dev/null | grep "^uid" | head -1 | sed 's/uid[[:space:]]*\[[^]]*\][[:space:]]*//')
|
local selected_user=$(gpg --list-secret-keys --keyid-format=long "$GPG_SIGN" 2>/dev/null | awk '/^uid/ {$1=""; $2="\b"; print; exit}')
|
||||||
echo "✅ Selected key: $GPG_SIGN - $selected_user"
|
echo "✅ Selected key: $GPG_SIGN - $selected_user"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
@ -122,28 +117,19 @@ import_gpg_key() {
|
||||||
echo " Press Ctrl+D when finished:"
|
echo " Press Ctrl+D when finished:"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
local temp_key_file=$(mktemp)
|
if gpg --import - 2>/dev/null; then
|
||||||
cat > "$temp_key_file"
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
echo "🔄 Importing key..."
|
|
||||||
|
|
||||||
if gpg --import "$temp_key_file" 2>/dev/null; then
|
|
||||||
echo "✅ GPG key imported successfully!"
|
echo "✅ GPG key imported successfully!"
|
||||||
else
|
else
|
||||||
echo "❌ Failed to import GPG key. Please check the format and try again."
|
echo "❌ Failed to import GPG key. Please check the format and try again."
|
||||||
rm -f "$temp_key_file"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f "$temp_key_file"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check requirements
|
# Check requirements
|
||||||
if ! command -v flatpak-builder &> /dev/null; then
|
if ! command -v flatpak-builder &> /dev/null; then
|
||||||
echo "❌ flatpak-builder is required but not installed"
|
echo "❌ flatpak-builder is required but not installed"
|
||||||
echo "Install with: sudo apt install flatpak-builder (Ubuntu/Debian)"
|
echo "Install with: sudo apt install flatpak-builder (Ubuntu/Debian)"
|
||||||
echo " sudo dnf install flatpak-builder (Fedora)"
|
echo " sudo dnf install flatpak-builder (Fedora)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -155,12 +141,12 @@ fi
|
||||||
if ! command -v jq &> /dev/null; then
|
if ! command -v jq &> /dev/null; then
|
||||||
echo "❌ jq is required but not installed"
|
echo "❌ jq is required but not installed"
|
||||||
echo "Install with: sudo apt install jq (Ubuntu/Debian)"
|
echo "Install with: sudo apt install jq (Ubuntu/Debian)"
|
||||||
echo " sudo dnf install jq (Fedora)"
|
echo " sudo dnf install jq (Fedora)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get repository info
|
# Get repository info
|
||||||
REPO_URL=$(git remote get-url origin 2>/dev/null || echo "")
|
REPO_URL=$(git remote get-url origin 2>/dev/null || :)
|
||||||
if [[ $REPO_URL =~ github\.com[:/]([^/]+)/([^/.]+) ]]; then
|
if [[ $REPO_URL =~ github\.com[:/]([^/]+)/([^/.]+) ]]; then
|
||||||
GITHUB_USER="${BASH_REMATCH[1]}"
|
GITHUB_USER="${BASH_REMATCH[1]}"
|
||||||
REPO_NAME="${BASH_REMATCH[2]}"
|
REPO_NAME="${BASH_REMATCH[2]}"
|
||||||
|
|
@ -203,12 +189,13 @@ echo ""
|
||||||
# Always use local .deb file - build if needed
|
# Always use local .deb file - build if needed
|
||||||
echo "🔍 Ensuring local .deb file exists..."
|
echo "🔍 Ensuring local .deb file exists..."
|
||||||
MANIFEST_FILE="flatpak/org.eigenwallet.app.json"
|
MANIFEST_FILE="flatpak/org.eigenwallet.app.json"
|
||||||
TEMP_MANIFEST=""
|
trap 'rm -f "$TEMP_MANIFEST"' EXIT INT
|
||||||
|
TEMP_MANIFEST=$(mktemp --suffix=.json)
|
||||||
|
|
||||||
# Look for the .deb file in the expected location
|
# Look for the .deb file in the expected location
|
||||||
DEB_FILE=$(find ./target/release/bundle/deb/ -name "*.deb" -not -name "*.deb.sig" 2>/dev/null | head -1)
|
DEB_FILE=$(find "$PWD/target/debug/bundle/deb/" -name "*.deb" -print -quit)
|
||||||
|
|
||||||
if [ -n "$DEB_FILE" ] && [ -f "$DEB_FILE" ]; then
|
if [ -f "$DEB_FILE" ]; then
|
||||||
echo "✅ Found local .deb file: $DEB_FILE"
|
echo "✅ Found local .deb file: $DEB_FILE"
|
||||||
else
|
else
|
||||||
echo "🏗️ No local .deb file found, building locally..."
|
echo "🏗️ No local .deb file found, building locally..."
|
||||||
|
|
@ -219,7 +206,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Extract version from Cargo.toml
|
# Extract version from Cargo.toml
|
||||||
VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/.*= "//' | sed 's/".*//')
|
VERSION=$(awk -F "[$IFS\"]*" '/^version/ { print $3; exit; }' Cargo.toml)
|
||||||
if [ -z "$VERSION" ]; then
|
if [ -z "$VERSION" ]; then
|
||||||
echo "❌ Could not determine version from Cargo.toml"
|
echo "❌ Could not determine version from Cargo.toml"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -229,8 +216,8 @@ else
|
||||||
./release-build.sh "$VERSION"
|
./release-build.sh "$VERSION"
|
||||||
|
|
||||||
# Look for the .deb file again
|
# Look for the .deb file again
|
||||||
DEB_FILE=$(find ./target/release/bundle/deb/ -name "*.deb" -not -name "*.deb.sig" 2>/dev/null | head -1)
|
DEB_FILE=$(find "$PWD/target/debug/bundle/deb/" -name "*.deb" -print -quit)
|
||||||
if [ -z "$DEB_FILE" ] || [ ! -f "$DEB_FILE" ]; then
|
if ! [ -f "$DEB_FILE" ]; then
|
||||||
echo "❌ Failed to build .deb file"
|
echo "❌ Failed to build .deb file"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
@ -238,39 +225,26 @@ else
|
||||||
echo "✅ Local build completed: $DEB_FILE"
|
echo "✅ Local build completed: $DEB_FILE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get the absolute path
|
|
||||||
DEB_ABSOLUTE_PATH=$(realpath "$DEB_FILE")
|
|
||||||
|
|
||||||
# Calculate SHA256 hash of the .deb file
|
# Calculate SHA256 hash of the .deb file
|
||||||
echo "🔢 Calculating SHA256 hash..."
|
echo "🔢 Calculating SHA256 hash..."
|
||||||
DEB_SHA256=$(sha256sum "$DEB_ABSOLUTE_PATH" | cut -d' ' -f1)
|
read -r DEB_SHA256 _ < <(sha256sum "$DEB_FILE")
|
||||||
echo " Hash: $DEB_SHA256"
|
echo " Hash: $DEB_SHA256"
|
||||||
|
|
||||||
# Create a temporary manifest with the local file
|
|
||||||
TEMP_MANIFEST=$(mktemp --suffix=.json)
|
|
||||||
|
|
||||||
echo "📝 Creating manifest with local .deb..."
|
echo "📝 Creating manifest with local .deb..."
|
||||||
|
|
||||||
# Modify the manifest to use the local file
|
# Modify the manifest to use the local file
|
||||||
jq --arg deb_path "file://$DEB_ABSOLUTE_PATH" --arg deb_hash "$DEB_SHA256" '
|
jq --arg deb_path "file://$DEB_FILE" --arg deb_hash "$DEB_SHA256" '
|
||||||
.modules[0].sources = [
|
.modules[0].sources = [
|
||||||
{
|
{
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"url": $deb_path,
|
"url": $deb_path,
|
||||||
"sha256": $deb_hash,
|
"sha256": $deb_hash
|
||||||
"dest": ".",
|
|
||||||
"dest-filename": "eigenwallet.deb"
|
|
||||||
}
|
}
|
||||||
] |
|
|
||||||
.modules[0]."build-commands" = [
|
|
||||||
"ar -x eigenwallet.deb",
|
|
||||||
"tar -xf data.tar.gz",
|
|
||||||
"install -Dm755 usr/bin/unstoppableswap-gui-rs /app/bin/unstoppableswap-gui-rs"
|
|
||||||
]
|
]
|
||||||
' "$MANIFEST_FILE" > "$TEMP_MANIFEST"
|
' "$MANIFEST_FILE" > "$TEMP_MANIFEST"
|
||||||
|
|
||||||
MANIFEST_FILE="$TEMP_MANIFEST"
|
MANIFEST_FILE="$TEMP_MANIFEST"
|
||||||
echo "📦 Using local build: $(basename "$DEB_FILE")"
|
echo "📦 Using local build: ${DEB_FILE##*/}"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
|
@ -318,59 +292,25 @@ if [ -n "$GPG_SIGN" ]; then
|
||||||
fi
|
fi
|
||||||
flatpak build-bundle "${BUNDLE_ARGS[@]}" org.eigenwallet.app
|
flatpak build-bundle "${BUNDLE_ARGS[@]}" org.eigenwallet.app
|
||||||
|
|
||||||
# Generate .flatpakrepo file
|
# Add GPG key only if signing
|
||||||
echo "📝 Generating .flatpakrepo file..."
|
|
||||||
cat > "$REPO_DIR/eigenwallet.flatpakrepo" << EOF
|
|
||||||
[Flatpak Repo]
|
|
||||||
Title=eigenwallet
|
|
||||||
Name=eigenwallet
|
|
||||||
Url=${PAGES_URL}/
|
|
||||||
Homepage=https://github.com/${GITHUB_USER}/${REPO_NAME}
|
|
||||||
Comment=Unstoppable cross-chain atomic swaps
|
|
||||||
Description=Repository for eigenwallet applications - providing secure and decentralized XMR-BTC atomic swaps
|
|
||||||
Icon=${PAGES_URL}/icon.png
|
|
||||||
SuggestRemoteName=eigenwallet
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Add GPG key if signing
|
|
||||||
if [ -n "$GPG_SIGN" ]; then
|
if [ -n "$GPG_SIGN" ]; then
|
||||||
echo "🔑 Adding GPG key to .flatpakrepo..."
|
echo "🔑 Adding GPG keys to .flatpakrepo and .flatpakref..."
|
||||||
GPG_KEY_B64=$(gpg --export "$GPG_SIGN" | base64 -w 0)
|
GPGKey="s|%GPGKey%|$(gpg --export "$GPG_SIGN" | base64 -w 0)|"
|
||||||
echo "GPGKey=$GPG_KEY_B64" >> "$REPO_DIR/eigenwallet.flatpakrepo"
|
else
|
||||||
|
GPGKey="/%GPGKey%/d"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Generate .flatpakref file
|
cp -v flatpak/*.flatpakre* "$REPO_DIR/"
|
||||||
echo "📝 Generating .flatpakref file..."
|
sed -e "s|%Url%|${PAGES_URL}|" \
|
||||||
cat > "$REPO_DIR/org.eigenwallet.app.flatpakref" << EOF
|
-e "s|%Homepage%|https://github.com/${GITHUB_USER}/${REPO_NAME}|" \
|
||||||
[Flatpak Ref]
|
-e "$GPGKey" \
|
||||||
Title=eigenwallet GUI
|
-i "$REPO_DIR"/*.flatpakre*
|
||||||
Name=org.eigenwallet.app
|
|
||||||
Branch=stable
|
|
||||||
Url=${PAGES_URL}/
|
|
||||||
SuggestRemoteName=eigenwallet
|
|
||||||
Homepage=https://github.com/${GITHUB_USER}/${REPO_NAME}
|
|
||||||
Icon=${PAGES_URL}/icon.png
|
|
||||||
RuntimeRepo=https://dl.flathub.org/repo/flathub.flatpakrepo
|
|
||||||
IsRuntime=false
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Add GPG key if signing
|
|
||||||
if [ -n "$GPG_SIGN" ]; then
|
|
||||||
GPG_KEY_B64=$(gpg --export "$GPG_SIGN" | base64 -w 0)
|
|
||||||
echo "GPGKey=$GPG_KEY_B64" >> "$REPO_DIR/org.eigenwallet.app.flatpakref"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Copy bundle to repo directory
|
# Copy bundle to repo directory
|
||||||
cp org.eigenwallet.app.flatpak "$REPO_DIR/"
|
cp org.eigenwallet.app.flatpak "$REPO_DIR/"
|
||||||
|
|
||||||
# Use index.html from flatpak directory
|
# Use index.html from flatpak directory
|
||||||
if [ -f "flatpak/index.html" ]; then
|
cp -v flatpak/index.html "$REPO_DIR/"
|
||||||
echo "Copying index.html from flatpak directory..."
|
|
||||||
cp flatpak/index.html "$REPO_DIR/index.html"
|
|
||||||
else
|
|
||||||
echo "Error: flatpak/index.html not found"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Copy any additional files
|
# Copy any additional files
|
||||||
if [ -f "icon.png" ]; then
|
if [ -f "icon.png" ]; then
|
||||||
|
|
@ -382,44 +322,27 @@ if [ -f "README.md" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add .nojekyll file to skip Jekyll processing
|
# Add .nojekyll file to skip Jekyll processing
|
||||||
touch "$REPO_DIR/.nojekyll"
|
>> "$REPO_DIR/.nojekyll"
|
||||||
|
|
||||||
echo "✅ Flatpak repository built successfully!"
|
echo "✅ Flatpak repository built successfully!"
|
||||||
echo "📊 Repository size: $(du -sh $REPO_DIR | cut -f1)"
|
echo "📊 Repository size: $(du -sh "$REPO_DIR" | { read -r s _; echo "$s"; })"
|
||||||
echo "📁 Repository files are in: $REPO_DIR/"
|
echo "📁 Repository files are in: $REPO_DIR/"
|
||||||
|
|
||||||
if [ "$PUSH_FLAG" = "--push" ]; then
|
if [ "$PUSH_FLAG" = "--push" ]; then
|
||||||
echo ""
|
echo ""
|
||||||
echo "🚀 Deploying to GitHub Pages..."
|
echo "🚀 Deploying to GitHub Pages..."
|
||||||
|
|
||||||
# Store current branch
|
|
||||||
CURRENT_BRANCH=$(git branch --show-current)
|
|
||||||
|
|
||||||
# Create a temporary directory for deployment
|
|
||||||
DEPLOY_DIR=$(mktemp -d)
|
|
||||||
|
|
||||||
# Copy flatpak repo to deploy directory (including hidden files)
|
|
||||||
echo "📁 Preparing deployment files..."
|
|
||||||
cp -r "$REPO_DIR"/. "$DEPLOY_DIR/"
|
|
||||||
|
|
||||||
# Initialize fresh git repo in deploy directory
|
# Initialize fresh git repo in deploy directory
|
||||||
cd "$DEPLOY_DIR"
|
git -C "$REPO_DIR" init
|
||||||
git init
|
git -C "$REPO_DIR" add .
|
||||||
git add .
|
git -C "$REPO_DIR" commit -m "Update Flatpak repository $(date -u '+%F %T %Z')"
|
||||||
git commit -m "Update Flatpak repository $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
|
|
||||||
|
|
||||||
# Go back to original directory
|
|
||||||
cd - > /dev/null
|
|
||||||
|
|
||||||
# Push to GitHub Pages branch
|
# Push to GitHub Pages branch
|
||||||
echo "🚀 Force pushing to $BRANCH..."
|
echo "🚀 Force pushing to $BRANCH..."
|
||||||
cd "$DEPLOY_DIR"
|
git -C "$REPO_DIR" push --force "$REPO_URL" HEAD:"$BRANCH"
|
||||||
git remote add origin "$(cd - > /dev/null && git remote get-url origin)"
|
|
||||||
git push --force origin HEAD:"$BRANCH"
|
|
||||||
|
|
||||||
# Return to original directory and clean up
|
# Clean up
|
||||||
cd - > /dev/null
|
rm -rf "$REPO_DIR/.git"
|
||||||
rm -rf "$DEPLOY_DIR"
|
|
||||||
|
|
||||||
echo "🎉 Deployed successfully!"
|
echo "🎉 Deployed successfully!"
|
||||||
echo "🌐 Your Flatpak repository is available at: $PAGES_URL"
|
echo "🌐 Your Flatpak repository is available at: $PAGES_URL"
|
||||||
|
|
@ -438,12 +361,3 @@ else
|
||||||
echo ""
|
echo ""
|
||||||
echo "📋 Or manually copy the contents of $REPO_DIR/ to your gh-pages branch"
|
echo "📋 Or manually copy the contents of $REPO_DIR/ to your gh-pages branch"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Cleanup temporary manifest if created
|
|
||||||
if [ -n "$TEMP_MANIFEST" ] && [ -f "$TEMP_MANIFEST" ]; then
|
|
||||||
rm -f "$TEMP_MANIFEST"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Cleanup
|
|
||||||
rm -rf "$TEMP_DIR"
|
|
||||||
echo "🧹 Cleanup completed"
|
|
||||||
11
flatpak/eigenwallet.flatpakrepo
Normal file
11
flatpak/eigenwallet.flatpakrepo
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
[Flatpak Repo]
|
||||||
|
Url=%Url%
|
||||||
|
Icon=%Url%/icon.png
|
||||||
|
SuggestRemoteName=eigenwallet
|
||||||
|
Homepage=%Homepage%
|
||||||
|
GPGKey=%GPGKey%
|
||||||
|
|
||||||
|
Title=eigenwallet
|
||||||
|
Name=eigenwallet
|
||||||
|
Comment=Unstoppable cross-chain atomic swaps
|
||||||
|
Description=Repository for eigenwallet applications - providing secure and decentralized XMR-BTC atomic swaps
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
{
|
|
||||||
"id": "net.unstoppableswap.gui",
|
|
||||||
"runtime": "org.gnome.Platform",
|
|
||||||
"runtime-version": "47",
|
|
||||||
"sdk": "org.gnome.Sdk",
|
|
||||||
"command": "unstoppableswap-gui-rs",
|
|
||||||
"finish-args": [
|
|
||||||
"--socket=wayland",
|
|
||||||
"--socket=fallback-x11",
|
|
||||||
"--device=dri",
|
|
||||||
"--share=ipc",
|
|
||||||
"--share=network",
|
|
||||||
"--talk-name=org.kde.StatusNotifierWatcher",
|
|
||||||
"--filesystem=xdg-run/tray-icon:create",
|
|
||||||
"--filesystem=~/.local/share/xmr-btc-swap"
|
|
||||||
],
|
|
||||||
"modules": [
|
|
||||||
{
|
|
||||||
"name": "binary",
|
|
||||||
"buildsystem": "simple",
|
|
||||||
"sources": [
|
|
||||||
{
|
|
||||||
"type": "file",
|
|
||||||
"url": "https://cdn.crabnebula.app/download/unstoppableswap/unstoppableswap-gui-rs/latest/platform/debian-x86_64",
|
|
||||||
"sha256": "f1fdb9dc164ed45e31fbba7209da23fa4cb1d461442c9dd0b6bc763b8bf1bb59",
|
|
||||||
"only-arches": ["x86_64"]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"build-commands": [
|
|
||||||
"ar -x *.deb",
|
|
||||||
"tar -xf data.tar.gz",
|
|
||||||
"install -Dm755 usr/bin/unstoppableswap-gui-rs /app/bin/unstoppableswap-gui-rs"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
12
flatpak/org.eigenwallet.app.flatpakref
Normal file
12
flatpak/org.eigenwallet.app.flatpakref
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
[Flatpak Ref]
|
||||||
|
Url=%Url%
|
||||||
|
Icon=%Url%/icon.png
|
||||||
|
SuggestRemoteName=eigenwallet
|
||||||
|
Homepage=%Homepage%
|
||||||
|
GPGKey=%GPGKey%
|
||||||
|
|
||||||
|
Title=eigenwallet GUI
|
||||||
|
Name=org.eigenwallet.app
|
||||||
|
Branch=stable
|
||||||
|
RuntimeRepo=https://dl.flathub.org/repo/flathub.flatpakrepo
|
||||||
|
IsRuntime=false
|
||||||
Loading…
Add table
Add a link
Reference in a new issue