diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index c3daa986..07d1b248 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -447,53 +447,6 @@ jobs: fi echo "Uploaded ${ZIP_NAME}" - # ── GitHub Mirror (BACKUP) ─────────────────────────────────────── - - name: "GitHub: Mirror release (stable/rc only)" - if: ${{ (steps.meta.outputs.stability == 'stable' || steps.meta.outputs.stability == 'rc') && secrets.GH_TOKEN != '' }} - continue-on-error: true - env: - EXT_ELEMENT: ${{ steps.meta.outputs.ext_element }} - run: | - TAG="${{ steps.meta.outputs.tag_name }}" - VERSION="${{ steps.bump.outputs.version }}" - STABILITY="${{ steps.meta.outputs.stability }}" - ZIP_NAME="${{ steps.bump.outputs.zip_name }}" - SHA256="${{ steps.zip.outputs.sha256 }}" - TOKEN="${{ secrets.GH_TOKEN }}" - GH_REPO="mokoconsulting-tech/${GITEA_REPO}" - GH_API="https://api.github.com/repos/${GH_REPO}" - - echo "=== GitHub Mirror ===" - IS_PRE="true" - [ "$STABILITY" = "stable" ] && IS_PRE="false" - - # Clean up existing - EXISTING=$(curl -sf -H "Authorization: token ${TOKEN}" \ - "${GH_API}/releases/tags/${TAG}" 2>/dev/null | jq -r '.id // empty') - [ -n "$EXISTING" ] && curl -sf -X DELETE -H "Authorization: token ${TOKEN}" "${GH_API}/releases/${EXISTING}" || true - curl -sf -X DELETE -H "Authorization: token ${TOKEN}" "${GH_API}/git/refs/tags/${TAG}" 2>/dev/null || true - - RELEASE_ID=$(curl -sS -X POST -H "Authorization: token ${TOKEN}" \ - -H "Content-Type: application/json" \ - "${GH_API}/releases" \ - -d "$(jq -n \ - --arg tag "$TAG" \ - --arg target "${{ github.sha }}" \ - --arg name "${EXT_ELEMENT} ${VERSION} ${STABILITY^} (mirror)" \ - --arg body "Mirror of Gitea release. SHA-256: \`${SHA256}\`" \ - --argjson pre "$IS_PRE" \ - '{tag_name: $tag, target_commitish: $target, name: $name, body: $body, prerelease: $pre, draft: false}' - )" | jq -r '.id') - - if [ -n "$RELEASE_ID" ] && [ "$RELEASE_ID" != "null" ]; then - curl -sf -X POST \ - -H "Authorization: token ${TOKEN}" \ - -H "Content-Type: application/octet-stream" \ - "https://uploads.github.com/repos/${GH_REPO}/releases/${RELEASE_ID}/assets?name=${ZIP_NAME}" \ - --data-binary "@build/${ZIP_NAME}" - echo "GitHub mirror uploaded: ${ZIP_NAME}" - fi - # ── Update updates.xml ────────────────────────────────────────── - name: "Update updates.xml with SHA and sync to main" run: | diff --git a/.gitea/workflows/update-server.yml b/.gitea/workflows/update-server.yml index 4b0caa6b..73f4e2a3 100644 --- a/.gitea/workflows/update-server.yml +++ b/.gitea/workflows/update-server.yml @@ -82,7 +82,7 @@ jobs: env: MOKO_CLONE_TOKEN: ${{ secrets.GA_TOKEN }} MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting - COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GH_TOKEN }}"}}' + COMPOSER_AUTH: '{"http-basic":{"git.mokoconsulting.tech":{"username":"token","password":"${{ secrets.GA_TOKEN }}"}}}' run: | if ! command -v composer &> /dev/null; then sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1 @@ -407,26 +407,6 @@ jobs: echo "WARNING: could not get updates.xml SHA from main" >> $GITHUB_STEP_SUMMARY fi - # -- Mirror to GitHub (stable and rc only) -------------------------------- - - name: Mirror release to GitHub - if: >- - (steps.update.outputs.stability == 'stable' || steps.update.outputs.stability == 'rc') && - secrets.GH_TOKEN != '' - continue-on-error: true - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - run: | - GH_REPO="${{ vars.GH_MIRROR_REPO || github.repository }}" - STABILITY="${{ steps.update.outputs.stability }}" - echo "GitHub mirror sync for ${STABILITY} — ${GH_REPO}" >> $GITHUB_STEP_SUMMARY - # Mirror packages if they exist - for PKG in /tmp/*.zip /tmp/*.tar.gz; do - if [ -f "$PKG" ]; then - _RELID=$(curl -sf -H "Authorization: token ${{ secrets.GA_TOKEN }}" "${GITEA_URL:-https://git.mokoconsulting.tech}/api/v1/repos/${{ github.repository }}/releases/tags/${RELEASE_TAG}" 2>/dev/null | jq -r ".id // empty") - [ -n "$_RELID" ] && curl -sf -X POST -H "Authorization: token ${{ secrets.GA_TOKEN }}" -H "Content-Type: application/octet-stream" "${GITEA_URL:-https://git.mokoconsulting.tech}/api/v1/repos/${{ github.repository }}/releases/${_RELID}/assets?name=$(basename $PKG)" --data-binary "@$PKG" > /dev/null 2>&1 || true - fi - done - - name: SFTP deploy to dev server if: contains(github.ref, 'dev/') || github.ref == 'refs/heads/dev' env: diff --git a/src/mokowaas.xml b/src/mokowaas.xml index a2bb0acd..fa11a19b 100644 --- a/src/mokowaas.xml +++ b/src/mokowaas.xml @@ -38,7 +38,6 @@ https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/raw/branch/main/updates.xml - https://raw.githubusercontent.com/mokoconsulting-tech/MokoWaaS/main/updates.xml