From 2720826c2214cccf0e034a6a2c22595ebc3116d6 Mon Sep 17 00:00:00 2001 From: CLARATION Date: Mon, 27 Jul 2026 16:35:10 -0700 Subject: [PATCH] feat(ci): upload to cdn after release --- .github/workflows/build.yml | 2 +- .github/workflows/repo-upload.yml | 30 ++++++++++++++++++++++++------ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ebac6c8..edcdf5f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -542,4 +542,4 @@ jobs: fail_on_unmatched_files: true draft: true env: - GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/repo-upload.yml b/.github/workflows/repo-upload.yml index 0ce475f..561617c 100644 --- a/.github/workflows/repo-upload.yml +++ b/.github/workflows/repo-upload.yml @@ -21,15 +21,20 @@ jobs: - name: Download debs from tag env: - GH_TOKEN: ${{ env.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh release download "${{ env.TAG }}" --pattern "palera1n-iphoneos-arm*.deb" + gh release download "${{ env.TAG }}" if [ ! -f "palera1n-iphoneos-arm64.deb" ] || [ ! -f "palera1n-iphoneos-arm.deb" ]; then echo "Debs not found :/" exit 1 fi + mkdir -p cdn-upload + cp *.tar.gz cdn-upload/ + cp *.deb cdn-upload/ + cp *.dmg cdn-upload/ + - name: Upload debs to repo if: github.repository == 'palera1n/palera1n' env: @@ -37,14 +42,14 @@ jobs: API_TOKEN: ${{ secrets.BUILD_GITHUB_TOKEN }} GH_REPO: palera1n/repo.palera.in run: | - git clone https://$USERNAME:$API_TOKEN@github.com/$GH_REPO.git upload + git clone https://$USERNAME:$API_TOKEN@github.com/$GH_REPO.git repo-upload ARM64_HASH=$(sha256sum palera1n-iphoneos-arm64.deb | cut -c1-8) ARM_HASH=$(sha256sum palera1n-iphoneos-arm.deb | cut -c1-8) - cp palera1n-iphoneos-arm64.deb upload/pool/iphoneos-arm64/palera1n_${{ env.TAG }}_${ARM64_HASH}_iphoneos-arm64.deb - cp palera1n-iphoneos-arm.deb upload/pool/iphoneos-arm/palera1n_${{ env.TAG }}_${ARM_HASH}_iphoneos-arm.deb + cp palera1n-iphoneos-arm64.deb repo-upload/pool/iphoneos-arm64/palera1n_${{ env.TAG }}_${ARM64_HASH}_iphoneos-arm64.deb + cp palera1n-iphoneos-arm.deb repo-upload/pool/iphoneos-arm/palera1n_${{ env.TAG }}_${ARM_HASH}_iphoneos-arm.deb - cd upload + cd repo-upload git config user.name "$USERNAME" git config user.email "actions@github.com" @@ -53,6 +58,19 @@ jobs: git commit -m "Update palera1n for ${{ env.TAG }}" || exit 0 git push https://$USERNAME:$API_TOKEN@github.com/$GH_REPO.git + - name: Upload artifacts to cdn + if: github.repository == 'palera1n/palera1n' + uses: wangyucode/sftp-upload-action@v3 + with: + host: ${{ secrets.NICKCHAN_FTP_HOST }} + port: ${{ secrets.NICKCHAN_FTP_PORT }} + username: palera1n + password: ${{ secrets.NICKCHAN_FTP_PASS }} + forceUpload: true + dryRun: false + localDir: 'cdn-upload' + remoteDir: "/palera1n/c-rewrite/releases/${{ env.TAG }}" + - name: Bump palen1x if: github.repository == 'palera1n/palera1n' env: