Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f61a31f28 | ||
| 491a5845f0 | |||
|
|
bd25ce8e1d | ||
| a5d44e191b | |||
| 5f4bf191fc |
@@ -7,6 +7,7 @@ on:
|
|||||||
- dev
|
- dev
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
increment-version:
|
increment-version:
|
||||||
|
|||||||
95
.gitea/workflows/update-submodule.yml
Normal file
95
.gitea/workflows/update-submodule.yml
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
name: Update cinny submodule
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
cinny_sha:
|
||||||
|
description: "cinny commit SHA to pin (defaults to origin/main)"
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: update-cinny-submodule
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
bump:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
submodules: false
|
||||||
|
# PAT so the submodule bump push can trigger build.yml
|
||||||
|
# (GITHUB_TOKEN pushes do not start new workflows).
|
||||||
|
token: ${{ secrets.ACTIONS_TOKEN }}
|
||||||
|
ref: master
|
||||||
|
|
||||||
|
- name: Update cinny submodule
|
||||||
|
id: bump
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
ORIGIN_URL=$(git remote get-url origin)
|
||||||
|
ORIGIN_URL=${ORIGIN_URL%/}
|
||||||
|
ORIGIN_URL=${ORIGIN_URL%.git}
|
||||||
|
BASE_URL=${ORIGIN_URL%/*}
|
||||||
|
CINNY_URL="${BASE_URL}/cinny.git"
|
||||||
|
echo "Rewriting submodule URL to ${CINNY_URL}"
|
||||||
|
git config submodule.cinny.url "${CINNY_URL}"
|
||||||
|
git submodule sync --recursive
|
||||||
|
git submodule update --init --recursive
|
||||||
|
|
||||||
|
TARGET_SHA="${{ inputs.cinny_sha }}"
|
||||||
|
git -C cinny fetch origin main
|
||||||
|
|
||||||
|
if [ -n "${TARGET_SHA}" ]; then
|
||||||
|
git -C cinny checkout --detach "${TARGET_SHA}"
|
||||||
|
else
|
||||||
|
git -C cinny checkout --detach origin/main
|
||||||
|
fi
|
||||||
|
|
||||||
|
NEW_SHA=$(git -C cinny rev-parse HEAD)
|
||||||
|
OLD_SHA=$(git rev-parse HEAD:cinny)
|
||||||
|
SUBJECT=$(git -C cinny log -1 --pretty=%s)
|
||||||
|
|
||||||
|
echo "old=${OLD_SHA}"
|
||||||
|
echo "new=${NEW_SHA}"
|
||||||
|
echo "subject=${SUBJECT}"
|
||||||
|
|
||||||
|
if [ "${OLD_SHA}" = "${NEW_SHA}" ]; then
|
||||||
|
echo "changed=false" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "cinny already at ${NEW_SHA}; nothing to do"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
git add cinny
|
||||||
|
git config user.name "GitHub Actions"
|
||||||
|
git config user.email "actions@github.com"
|
||||||
|
git commit -m "Bump cinny: ${SUBJECT}"
|
||||||
|
|
||||||
|
{
|
||||||
|
echo "changed=true"
|
||||||
|
echo "sha=${NEW_SHA}"
|
||||||
|
} >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Push submodule bump
|
||||||
|
if: steps.bump.outputs.changed == 'true'
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
for attempt in 1 2 3; do
|
||||||
|
git fetch origin master
|
||||||
|
git rebase origin/master || {
|
||||||
|
git rebase --abort || true
|
||||||
|
echo "Failed to rebase submodule bump onto latest master"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
if git push origin HEAD:master; then
|
||||||
|
echo "Pushed cinny bump (${{ steps.bump.outputs.sha }})"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "Push rejected on attempt ${attempt}, retrying"
|
||||||
|
done
|
||||||
|
echo "Failed to push submodule bump after 3 attempts"
|
||||||
|
exit 1
|
||||||
2
cinny
2
cinny
Submodule cinny updated: 0da4f0d6cb...32bf2cbed5
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "paarrot",
|
"name": "paarrot",
|
||||||
"version": "4.11.145",
|
"version": "4.11.146",
|
||||||
"description": "Paarrot - A Matrix client based on Cinny",
|
"description": "Paarrot - A Matrix client based on Cinny",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0"
|
"node": ">=18.0.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user