diff --git a/.gitea/workflows/trigger-desktop.yml b/.gitea/workflows/trigger-desktop.yml index 21784eecd..1609e817a 100644 --- a/.gitea/workflows/trigger-desktop.yml +++ b/.gitea/workflows/trigger-desktop.yml @@ -8,13 +8,30 @@ jobs: trigger: runs-on: ubuntu-latest steps: - - name: Trigger cinny-desktop release build + - name: Bump cinny submodule in cinny-desktop and push env: TOKEN: ${{ secrets.RELEASE_TOKEN }} run: | - curl -sf -X POST \ - "https://code.lotusguild.org/api/v1/repos/LotusGuild/cinny-desktop/actions/workflows/release.yml/dispatches" \ - -H "Authorization: token $TOKEN" \ - -H "Content-Type: application/json" \ - -d '{"ref":"main"}' - echo "Desktop build triggered" + CINNY_SHA="${{ github.sha }}" + echo "Bumping cinny submodule to $CINNY_SHA" + + git clone "https://x-access-token:$TOKEN@code.lotusguild.org/LotusGuild/cinny-desktop.git" desktop + cd desktop + + git config user.email "ci@lotusguild.org" + git config user.name "Lotus CI" + + # Fetch the cinny submodule and point it at the new SHA + git submodule update --init cinny + git -C cinny fetch origin + git -C cinny checkout "$CINNY_SHA" + + git add cinny + # Only commit + push if the submodule pointer actually changed + if git diff --cached --quiet; then + echo "Submodule already at $CINNY_SHA — no push needed" + else + git commit -m "chore: bump cinny submodule to ${CINNY_SHA:0:8}" + git push origin main + echo "Pushed — cinny-desktop release build triggered" + fi