mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-23 09:08:32 +02:00
Revert "Simplify CI: metainfo releases only accumulate in Flathub repo"
This reverts commit f265b7a572.
This commit is contained in:
17
.github/workflows/flathub.yml
vendored
17
.github/workflows/flathub.yml
vendored
@@ -4,7 +4,7 @@ on:
|
|||||||
types: [published]
|
types: [published]
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-flathub:
|
update-flathub:
|
||||||
@@ -34,6 +34,15 @@ jobs:
|
|||||||
- 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 }}"
|
||||||
|
|
||||||
|
- name: Commit metainfo update to app repo
|
||||||
|
run: |
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git add flatpak/app.yaak.Yaak.metainfo.xml
|
||||||
|
git diff --cached --quiet && echo "No metainfo changes" && exit 0
|
||||||
|
git commit -m "Add ${{ github.event.release.tag_name }} to metainfo releases"
|
||||||
|
git push origin HEAD:main
|
||||||
|
|
||||||
- name: Checkout Flathub repo
|
- name: Checkout Flathub repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -42,19 +51,15 @@ jobs:
|
|||||||
path: flathub-repo
|
path: flathub-repo
|
||||||
|
|
||||||
- name: Copy updated files to Flathub repo
|
- name: Copy updated files to Flathub repo
|
||||||
env:
|
|
||||||
VERSION: ${{ github.event.release.tag_name }}
|
|
||||||
run: |
|
run: |
|
||||||
cp flatpak/app.yaak.Yaak.yml flathub-repo/
|
cp flatpak/app.yaak.Yaak.yml flathub-repo/
|
||||||
|
cp flatpak/app.yaak.Yaak.metainfo.xml flathub-repo/
|
||||||
cp flatpak/cargo-sources.json flathub-repo/
|
cp flatpak/cargo-sources.json flathub-repo/
|
||||||
cp flatpak/node-sources.json flathub-repo/
|
cp flatpak/node-sources.json flathub-repo/
|
||||||
cp LICENSE flathub-repo/
|
cp LICENSE flathub-repo/
|
||||||
# Rewrite paths for Flathub repo flat structure
|
|
||||||
sed -i 's|path: \.\./LICENSE|path: LICENSE|' flathub-repo/app.yaak.Yaak.yml
|
sed -i 's|path: \.\./LICENSE|path: LICENSE|' flathub-repo/app.yaak.Yaak.yml
|
||||||
sed -i 's|install -Dm644 flatpak/app.yaak.Yaak.metainfo.xml|install -Dm644 app.yaak.Yaak.metainfo.xml|' flathub-repo/app.yaak.Yaak.yml
|
sed -i 's|install -Dm644 flatpak/app.yaak.Yaak.metainfo.xml|install -Dm644 app.yaak.Yaak.metainfo.xml|' flathub-repo/app.yaak.Yaak.yml
|
||||||
sed -i '/path: LICENSE/a\ # Metainfo file (with release history)\n - type: file\n path: app.yaak.Yaak.metainfo.xml' flathub-repo/app.yaak.Yaak.yml
|
sed -i '/path: LICENSE/a\ # Metainfo file (with release history)\n - type: file\n path: app.yaak.Yaak.metainfo.xml' flathub-repo/app.yaak.Yaak.yml
|
||||||
# Add new release to Flathub metainfo (accumulates over time)
|
|
||||||
sed -i "s| <releases>| <releases>\n <release version=\"${VERSION#v}\" date=\"$(date +%Y-%m-%d)\" />|" flathub-repo/app.yaak.Yaak.metainfo.xml
|
|
||||||
|
|
||||||
- name: Commit and push to Flathub
|
- name: Commit and push to Flathub
|
||||||
working-directory: flathub-repo
|
working-directory: flathub-repo
|
||||||
|
|||||||
@@ -8,12 +8,14 @@
|
|||||||
# This script:
|
# This script:
|
||||||
# 1. Updates the git tag and commit in the manifest
|
# 1. Updates the git tag and commit in the manifest
|
||||||
# 2. Regenerates cargo-sources.json and node-sources.json from the tagged lockfiles
|
# 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"
|
MANIFEST="$SCRIPT_DIR/app.yaak.Yaak.yml"
|
||||||
|
METAINFO="$SCRIPT_DIR/app.yaak.Yaak.metainfo.xml"
|
||||||
|
|
||||||
if [ $# -lt 1 ]; then
|
if [ $# -lt 1 ]; then
|
||||||
echo "Usage: $0 <version-tag>"
|
echo "Usage: $0 <version-tag>"
|
||||||
@@ -74,8 +76,14 @@ node -e "
|
|||||||
flatpak-node-generator --no-requests-cache \
|
flatpak-node-generator --no-requests-cache \
|
||||||
-o "$SCRIPT_DIR/node-sources.json" npm "$TMPDIR/package-lock.json"
|
-o "$SCRIPT_DIR/node-sources.json" npm "$TMPDIR/package-lock.json"
|
||||||
|
|
||||||
|
# Update metainfo with new release
|
||||||
|
TODAY=$(date +%Y-%m-%d)
|
||||||
|
sed -i "s| <releases>| <releases>\n <release version=\"$VERSION\" date=\"$TODAY\" />|" "$METAINFO"
|
||||||
|
echo "Updated metainfo with release $VERSION."
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Done! Review the changes:"
|
echo "Done! Review the changes:"
|
||||||
echo " $MANIFEST"
|
echo " $MANIFEST"
|
||||||
|
echo " $METAINFO"
|
||||||
echo " $SCRIPT_DIR/cargo-sources.json"
|
echo " $SCRIPT_DIR/cargo-sources.json"
|
||||||
echo " $SCRIPT_DIR/node-sources.json"
|
echo " $SCRIPT_DIR/node-sources.json"
|
||||||
|
|||||||
Reference in New Issue
Block a user