mirror of
https://git.quad4.io/RNS-Things/MeshChatX.git
synced 2026-09-22 07:04:26 +00:00
73 lines
3.1 KiB
YAML
73 lines
3.1 KiB
YAML
# Upstream GitHub (Win/mac CI artifacts): https://github.com/Sudo-Ivan/MeshChatX
|
|
# This Gitea project (releases + API uploads): https://git.quad4.io/RNS-Things/MeshChatX
|
|
# Secret GITEA_API_URL: API origin https://git.quad4.io (no trailing slash), same as .gitea/workflows/build.yml
|
|
#
|
|
# Pull Windows/macOS artifacts from GitHub Actions (.github/workflows/build-release.yml) and
|
|
# attach them to the Gitea release for the same tag (Linux assets come from build.yml).
|
|
#
|
|
# On GitHub: tag push runs build-release.yml; branch pushes to "dev" only run .github/workflows/build.yml
|
|
# (no Win/mac artifact upload).
|
|
#
|
|
# Repository secrets:
|
|
# GITEA_API_URL, GITEA_TOKEN — same as .gitea/workflows/build.yml
|
|
# GITHUB_SYNC_PAT — GitHub PAT: repo + actions:read (list/download workflow artifacts)
|
|
#
|
|
# Run after the Gitea "Build and Release" job has created the draft (or any release with that tag).
|
|
name: Sync GitHub Win/mac release assets
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: "Tag matching GitHub and Gitea (e.g. v4.4.0)"
|
|
required: true
|
|
type: string
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
GITHUB_SYNC_REPOSITORY: Sudo-Ivan/MeshChatX
|
|
GITEA_SYNC_REPOSITORY: RNS-Things/MeshChatX
|
|
GITEA_API_URL: ${{ secrets.GITEA_API_URL }}
|
|
|
|
jobs:
|
|
sync:
|
|
name: Fetch GitHub artifacts and upload to Gitea release
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Clone repository
|
|
run: |
|
|
set -eu
|
|
SERVER="${GITEA_SERVER_URL:-${GITHUB_SERVER_URL:-}}"
|
|
REPO="${GITEA_REPOSITORY:-${GITHUB_REPOSITORY:-}}"
|
|
if [ -z "$SERVER" ] || [ -z "$REPO" ]; then
|
|
echo "Set GITEA_SERVER_URL/GITEA_REPOSITORY or GITHUB_SERVER_URL/GITHUB_REPOSITORY" >&2
|
|
exit 1
|
|
fi
|
|
if [ -n "${GITEA_TOKEN:-}" ] || [ -n "${GITHUB_TOKEN:-}" ]; then
|
|
TOKEN="${GITEA_TOKEN:-$GITHUB_TOKEN}"
|
|
git config --global credential.helper "!f() { echo username=x-access-token; echo password=${TOKEN}; }; f"
|
|
fi
|
|
git clone "${SERVER}/${REPO}.git" .
|
|
git checkout "${GITHUB_SHA}"
|
|
|
|
- name: Sync from GitHub Actions
|
|
env:
|
|
TAG: ${{ inputs.tag }}
|
|
GITHUB_REPOSITORY: ${{ env.GITHUB_SYNC_REPOSITORY }}
|
|
GITHUB_PAT: ${{ secrets.GITHUB_SYNC_PAT }}
|
|
GITEA_REPOSITORY: ${{ env.GITEA_SYNC_REPOSITORY }}
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
run: |
|
|
set -eu
|
|
if [ -z "${GITHUB_PAT:-}" ]; then
|
|
echo "Configure secret GITHUB_SYNC_PAT." >&2
|
|
exit 1
|
|
fi
|
|
if [ -z "${GITEA_API_URL:-}" ]; then
|
|
echo "Configure secret GITEA_API_URL (https://git.quad4.io for RNS-Things/MeshChatX)." >&2
|
|
exit 1
|
|
fi
|
|
bash scripts/ci/sync-github-release-assets.sh
|