update(workflow): use forgejo cache

This commit is contained in:
Kyush 2026-03-11 01:56:02 +09:00
commit fdcaab21cb

View file

@ -18,7 +18,7 @@ env:
FLUTTER_VERSION: "3.24.5"
ANDROID_FLUTTER_VERSION: "3.24.5"
TAG_NAME: "${{ inputs.upload-tag }}"
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
VCPKG_BINARY_SOURCES: "clear;files,/opt/vcpkg-cache,readwrite"
VCPKG_COMMIT_ID: "120deac3062162151622ca4860575a33844ba10b"
VERSION: "1.4.6"
NDK_VERSION: "r27c"
@ -61,13 +61,6 @@ jobs:
docker-images: true
swap-storage: false
- name: Export GitHub Actions cache environment variables
uses: https://github.com/actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install dependencies
run: |
sudo apt-get update
@ -113,6 +106,7 @@ jobs:
with:
channel: "stable"
flutter-version: ${{ env.ANDROID_FLUTTER_VERSION }}
cache: true
- name: Patch flutter
run: |
@ -125,12 +119,20 @@ jobs:
ndk-version: ${{ env.NDK_VERSION }}
add-to-path: true
- name: Setup vcpkg with Github Actions binary cache
# vcpkg 빌드 바이너리 캐시 — 첫 실행 이후 수시간 절약
# 캐시 키: VCPKG_COMMIT_ID + target arch 조합 → arch별 독립 캐시
- name: Cache vcpkg binary cache
uses: actions/cache@v3
with:
path: /opt/vcpkg-cache
key: vcpkg-android-${{ matrix.job.target }}-${{ env.VCPKG_COMMIT_ID }}
- name: Setup vcpkg
uses: https://github.com/lukka/run-vcpkg@v11
with:
vcpkgDirectory: /opt/artifacts/vcpkg
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }}
doNotCache: false
doNotCache: true # run-vcpkg 자체 캐시 비활성화 (위의 actions/cache로 대체)
- name: Install vcpkg dependencies
shell: bash
@ -138,6 +140,7 @@ jobs:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
mkdir -p /opt/vcpkg-cache
case ${{ matrix.job.target }} in
aarch64-linux-android) ANDROID_TARGET=arm64-v8a ;;
armv7-linux-androideabi) ANDROID_TARGET=armeabi-v7a ;;
@ -168,13 +171,21 @@ jobs:
prefix-key: rustdesk-lib-cache-android
key: ${{ matrix.job.target }}
# cargo-ndk 바이너리 캐시 — 버전 고정이므로 거의 항상 hit
- name: Cache cargo-ndk binary
uses: actions/cache@v3
with:
path: ~/.cargo/bin/cargo-ndk
key: cargo-ndk-${{ env.CARGO_NDK_VERSION }}-${{ runner.os }}
- name: Build rustdesk lib
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
rustup target add ${{ matrix.job.target }}
cargo install cargo-ndk --version ${{ env.CARGO_NDK_VERSION }} --locked
# 캐시 hit 시 재설치 생략
command -v cargo-ndk &>/dev/null || cargo install cargo-ndk --version ${{ env.CARGO_NDK_VERSION }} --locked
case ${{ matrix.job.target }} in
aarch64-linux-android)
./flutter/ndk_arm64.sh
@ -297,13 +308,6 @@ jobs:
docker-images: true
swap-storage: false
- name: Export GitHub Actions cache environment variables
uses: https://github.com/actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install dependencies
run: |
sudo apt-get update
@ -327,6 +331,7 @@ jobs:
with:
channel: "stable"
flutter-version: ${{ env.ANDROID_FLUTTER_VERSION }}
cache: true
- name: Patch flutter
run: |