diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 9878b12..4105646 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -155,6 +155,44 @@ jobs: name: M9A-macos-${{ matrix.arch }} path: "install" + mirrorchyan_res: + needs: meta + runs-on: macos-latest + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Download MaaFramework + uses: robinraju/release-downloader@v1 + with: + repository: MaaXYZ/MaaFramework + fileName: "MAA-macos-aarch64*" + latest: true + out-file-path: "deps" + extract: true + + - name: Install + shell: bash + run: | + python ./install.py ${{ needs.meta.outputs.tag }} + + - name: MirrorChyan Package + id: zip + run: | + rm -rf install/resource/base/model/ocr + + mkdir MirrorChyan + zip -r MirrorChyan/${{ github.event.repository.name }}.zip install/resource install/interface.json + + - uses: actions/upload-artifact@v4 + with: + name: MirrorChyanRes + path: MirrorChyan + android: needs: meta runs-on: macos-latest @@ -189,13 +227,22 @@ jobs: release: if: ${{ needs.meta.outputs.is_release == 'true' }} - needs: [meta, windows, ubuntu, macos, android] + needs: [meta, windows, ubuntu, macos, android, mirrorchyan_res] runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v4 with: path: assets + - name: Upload to MirrorChyan + run: | + curl --location --request POST 'https://mirrorc.top/api/resources/${{ github.event.repository.name }}/versions' \ + --header 'Authorization:${{ secrets.MirrorChyanUploadToken }}' \ + --form 'name="${{ needs.meta.outputs.tag }}"' \ + --form 'file=@"assets/MirrorChyanRes/${{ github.event.repository.name }}.zip"' + + rm -rf assets/MirrorChyanRes + - name: Check assets directory run: | ls -la assets diff --git a/.github/workflows/mirrorchyan.yml b/.github/workflows/mirrorchyan.yml deleted file mode 100644 index 96fa6d5..0000000 --- a/.github/workflows/mirrorchyan.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: mirrorchyan - -on: - push: - tags: - - "v*" - workflow_dispatch: - -jobs: - upload: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Version Name - id: version_name - run: | - is_release=${{ startsWith(github.ref, 'refs/tags/v') }} - tag=$(git describe --tags --match "v*" ${{ github.ref }} || true) - if [[ $tag != v* ]]; then - tag=$(curl -sX GET "https://api.github.com/repos/${{ github.repository }}/releases/latest" --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' | awk '/tag_name/{print $4}' FS='["]') - if [[ $tag != v* ]]; then - tag="v0.0.0" - fi - tag=$(date "+$tag-%y%m%d-$(git rev-parse --short HEAD)") - fi - if ! $($is_release) ; then - prefix=${tag%-*-*} - suffix=${tag#$prefix-} - tag="$prefix-ci.$suffix" - fi - - echo version=$tag | tee -a $GITHUB_OUTPUT - - - name: Zip - id: zip - run: | - mkdir MirrorChyan - zip -r MirrorChyan/${{ github.event.repository.name }}.zip assets/resource assets/interface.json - - - uses: actions/upload-artifact@v4 - with: - name: MirrorChyan - path: MirrorChyan - - - name: Upload to MirrorChyan - run: | - curl --location --request POST 'https://mirrorc.top/api/resources/${{ github.event.repository.name }}/versions' \ - --header 'Authorization:${{ secrets.MirrorChyanUploadToken }}' \ - --form 'name="${{ steps.version_name.outputs.version }}"' \ - --form 'file=@"MirrorChyan/${{ github.event.repository.name }}.zip"'