mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-07-05 20:41:58 +02:00
Move build scripts to Flathub repo, keep release prep scripts here
This commit is contained in:
@@ -16,6 +16,13 @@ jobs:
|
|||||||
- name: Checkout app repo
|
- name: Checkout app repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Checkout Flathub repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: flathub/app.yaak.Yaak
|
||||||
|
token: ${{ secrets.FLATHUB_TOKEN }}
|
||||||
|
path: flathub-repo
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
@@ -32,22 +39,7 @@ jobs:
|
|||||||
git clone --depth 1 https://github.com/flatpak/flatpak-builder-tools flatpak/flatpak-builder-tools
|
git clone --depth 1 https://github.com/flatpak/flatpak-builder-tools flatpak/flatpak-builder-tools
|
||||||
|
|
||||||
- name: Run update-manifest.sh
|
- name: Run update-manifest.sh
|
||||||
run: bash flatpak/update-manifest.sh "${{ github.event.release.tag_name }}"
|
run: bash flatpak/update-manifest.sh "${{ github.event.release.tag_name }}" flathub-repo
|
||||||
|
|
||||||
- name: Checkout Flathub repo
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
repository: flathub/app.yaak.Yaak
|
|
||||||
token: ${{ secrets.FLATHUB_TOKEN }}
|
|
||||||
path: flathub-repo
|
|
||||||
|
|
||||||
- name: Copy updated files to Flathub repo
|
|
||||||
run: |
|
|
||||||
cp flatpak/app.yaak.Yaak.yml flathub-repo/
|
|
||||||
cp flatpak/cargo-sources.json flathub-repo/
|
|
||||||
cp flatpak/node-sources.json flathub-repo/
|
|
||||||
cp LICENSE flathub-repo/
|
|
||||||
sed -i 's|path: \.\./LICENSE|path: LICENSE|' flathub-repo/app.yaak.Yaak.yml
|
|
||||||
|
|
||||||
- name: Commit and push to Flathub
|
- name: Commit and push to Flathub
|
||||||
working-directory: flathub-repo
|
working-directory: flathub-repo
|
||||||
|
|||||||
@@ -7,20 +7,25 @@
|
|||||||
# Clone https://github.com/flatpak/flatpak-builder-tools (for cargo generator)
|
# Clone https://github.com/flatpak/flatpak-builder-tools (for cargo generator)
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# ./flatpak/generate-sources.sh
|
# ./flatpak/generate-sources.sh <flathub-repo-path>
|
||||||
|
# ./flatpak/generate-sources.sh ../flathub-repo
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||||
|
|
||||||
# Generate cargo-sources.json
|
if [ $# -lt 1 ]; then
|
||||||
python3 "$SCRIPT_DIR/flatpak-builder-tools/cargo/flatpak-cargo-generator.py" \
|
echo "Usage: $0 <flathub-repo-path>"
|
||||||
-o "$SCRIPT_DIR/cargo-sources.json" "$REPO_ROOT/Cargo.lock"
|
echo "Example: $0 ../flathub-repo"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
FLATHUB_REPO="$(cd "$1" && pwd)"
|
||||||
|
|
||||||
|
python3 "$SCRIPT_DIR/flatpak-builder-tools/cargo/flatpak-cargo-generator.py" \
|
||||||
|
-o "$FLATHUB_REPO/cargo-sources.json" "$REPO_ROOT/Cargo.lock"
|
||||||
|
|
||||||
# Generate node-sources.json from a patched copy of the lockfile.
|
|
||||||
# npm omits resolved/integrity for some workspace deps, and
|
|
||||||
# flatpak-node-generator can't handle workspace link entries.
|
|
||||||
TMPDIR=$(mktemp -d)
|
TMPDIR=$(mktemp -d)
|
||||||
trap 'rm -rf "$TMPDIR"' EXIT
|
trap 'rm -rf "$TMPDIR"' EXIT
|
||||||
|
|
||||||
@@ -40,4 +45,4 @@ node -e "
|
|||||||
" "$TMPDIR/package-lock.json"
|
" "$TMPDIR/package-lock.json"
|
||||||
|
|
||||||
flatpak-node-generator --no-requests-cache \
|
flatpak-node-generator --no-requests-cache \
|
||||||
-o "$SCRIPT_DIR/node-sources.json" npm "$TMPDIR/package-lock.json"
|
-o "$FLATHUB_REPO/node-sources.json" npm "$TMPDIR/package-lock.json"
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
// Adds missing `resolved` URLs to package-lock.json for nested workspace deps.
|
|
||||||
// npm omits these fields for some packages (see https://github.com/npm/cli/issues/4460),
|
|
||||||
// which breaks offline installs. This script constructs the URL from the package
|
|
||||||
// name and version without requiring network access.
|
|
||||||
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const p = process.argv[2] || "package-lock.json";
|
|
||||||
const d = JSON.parse(fs.readFileSync(p, "utf-8"));
|
|
||||||
|
|
||||||
for (const [name, info] of Object.entries(d.packages || {})) {
|
|
||||||
if (!name || info.link || info.resolved) continue;
|
|
||||||
if (!name.includes("node_modules/") || !info.version) continue;
|
|
||||||
const pkg = name.split("node_modules/").pop();
|
|
||||||
const base = pkg.split("/").pop();
|
|
||||||
info.resolved =
|
|
||||||
"https://registry.npmjs.org/" + pkg + "/-/" + base + "-" + info.version + ".tgz";
|
|
||||||
}
|
|
||||||
|
|
||||||
fs.writeFileSync(p, JSON.stringify(d, null, 2));
|
|
||||||
+13
-16
@@ -1,30 +1,27 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# Update the Flatpak manifest for a new release.
|
# Update the Flathub repo for a new release.
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# ./flatpak/update-manifest.sh v2026.2.0
|
# ./flatpak/update-manifest.sh <version-tag> <flathub-repo-path>
|
||||||
#
|
# ./flatpak/update-manifest.sh v2026.2.0 ../flathub-repo
|
||||||
# This script:
|
|
||||||
# 1. Updates the git tag and commit in the manifest
|
|
||||||
# 2. Regenerates cargo-sources.json and node-sources.json from the tagged lockfiles
|
|
||||||
# 3. Adds a new <release> entry to the metainfo
|
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||||
MANIFEST="$SCRIPT_DIR/app.yaak.Yaak.yml"
|
|
||||||
METAINFO="$SCRIPT_DIR/app.yaak.Yaak.metainfo.xml"
|
|
||||||
|
|
||||||
if [ $# -lt 1 ]; then
|
if [ $# -lt 2 ]; then
|
||||||
echo "Usage: $0 <version-tag>"
|
echo "Usage: $0 <version-tag> <flathub-repo-path>"
|
||||||
echo "Example: $0 v2026.2.0"
|
echo "Example: $0 v2026.2.0 ../flathub-repo"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
VERSION_TAG="$1"
|
VERSION_TAG="$1"
|
||||||
VERSION="${VERSION_TAG#v}"
|
VERSION="${VERSION_TAG#v}"
|
||||||
|
FLATHUB_REPO="$(cd "$2" && pwd)"
|
||||||
|
MANIFEST="$FLATHUB_REPO/app.yaak.Yaak.yml"
|
||||||
|
METAINFO="$SCRIPT_DIR/app.yaak.Yaak.metainfo.xml"
|
||||||
|
|
||||||
if [[ "$VERSION" == *-* ]]; then
|
if [[ "$VERSION" == *-* ]]; then
|
||||||
echo "Skipping pre-release version '$VERSION_TAG' (only stable releases are published to Flathub)"
|
echo "Skipping pre-release version '$VERSION_TAG' (only stable releases are published to Flathub)"
|
||||||
@@ -58,7 +55,7 @@ curl -fsSL "https://raw.githubusercontent.com/$REPO/$VERSION_TAG/package.json" -
|
|||||||
|
|
||||||
echo "Generating cargo-sources.json..."
|
echo "Generating cargo-sources.json..."
|
||||||
python3 "$SCRIPT_DIR/flatpak-builder-tools/cargo/flatpak-cargo-generator.py" \
|
python3 "$SCRIPT_DIR/flatpak-builder-tools/cargo/flatpak-cargo-generator.py" \
|
||||||
-o "$SCRIPT_DIR/cargo-sources.json" "$TMPDIR/Cargo.lock"
|
-o "$FLATHUB_REPO/cargo-sources.json" "$TMPDIR/Cargo.lock"
|
||||||
|
|
||||||
echo "Generating node-sources.json..."
|
echo "Generating node-sources.json..."
|
||||||
node "$SCRIPT_DIR/fix-lockfile.mjs" "$TMPDIR/package-lock.json"
|
node "$SCRIPT_DIR/fix-lockfile.mjs" "$TMPDIR/package-lock.json"
|
||||||
@@ -74,7 +71,7 @@ node -e "
|
|||||||
" "$TMPDIR/package-lock.json"
|
" "$TMPDIR/package-lock.json"
|
||||||
|
|
||||||
flatpak-node-generator --no-requests-cache \
|
flatpak-node-generator --no-requests-cache \
|
||||||
-o "$SCRIPT_DIR/node-sources.json" npm "$TMPDIR/package-lock.json"
|
-o "$FLATHUB_REPO/node-sources.json" npm "$TMPDIR/package-lock.json"
|
||||||
|
|
||||||
# Update metainfo with new release
|
# Update metainfo with new release
|
||||||
TODAY=$(date +%Y-%m-%d)
|
TODAY=$(date +%Y-%m-%d)
|
||||||
@@ -85,5 +82,5 @@ echo ""
|
|||||||
echo "Done! Review the changes:"
|
echo "Done! Review the changes:"
|
||||||
echo " $MANIFEST"
|
echo " $MANIFEST"
|
||||||
echo " $METAINFO"
|
echo " $METAINFO"
|
||||||
echo " $SCRIPT_DIR/cargo-sources.json"
|
echo " $FLATHUB_REPO/cargo-sources.json"
|
||||||
echo " $SCRIPT_DIR/node-sources.json"
|
echo " $FLATHUB_REPO/node-sources.json"
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Categories=Development;
|
|
||||||
Comment=The API client for modern developers
|
|
||||||
Exec=yaak-app
|
|
||||||
Icon=yaak-app
|
|
||||||
Name=Yaak
|
|
||||||
StartupWMClass=yaak
|
|
||||||
Terminal=false
|
|
||||||
Type=Application
|
|
||||||
Reference in New Issue
Block a user