From 1e287a90fc81dc10c6e489de223ea25fa6cf938c Mon Sep 17 00:00:00 2001 From: wukongdaily <143675923+wukongdaily@users.noreply.github.com> Date: Mon, 10 Feb 2025 18:10:52 +0800 Subject: [PATCH] =?UTF-8?q?mihomo=E6=9B=B4=E5=90=8Dnikki?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/mihomerun.yml | 105 ------------------------------- .github/workflows/nikki.yml | 106 ++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+), 105 deletions(-) delete mode 100644 .github/workflows/mihomerun.yml create mode 100644 .github/workflows/nikki.yml diff --git a/.github/workflows/mihomerun.yml b/.github/workflows/mihomerun.yml deleted file mode 100644 index 293a749..0000000 --- a/.github/workflows/mihomerun.yml +++ /dev/null @@ -1,105 +0,0 @@ -#================================================= -# https://github.com/wukongdaily/RunFilesBuilder -# Description: Build RunFiles using GitHub Actions -# Lisence: MIT -# Author: wukongdaily -# Blog: wkdaily.cpolar.top -#================================================= - -name: Make MiHomo run files for 23.05 - -on: - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-22.04 - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Fetch latest release tag from mihomo - id: fetch_latest_tag - run: | - latest_tag=$(curl -s https://api.github.com/repos/morytyann/OpenWrt-mihomo/releases/latest | jq -r '.tag_name') - echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV - # https://github.com/morytyann/OpenWrt-mihomo/releases/download/v1.17.1/mihomo_aarch64_cortex-a53-openwrt-24.10.tar.gz - - - name: Clone makeself repository - run: git clone https://github.com/megastep/makeself.git - - - name: Download latest mihomo files - run: | - curl -LO $(curl -s https://api.github.com/repos/morytyann/OpenWrt-mihomo/releases/latest | grep -oP '"browser_download_url":\s*".*mihomo_aarch64_cortex-a53-openwrt-24.10.tar.gz"' | cut -d '"' -f 4) - curl -LO $(curl -s https://api.github.com/repos/morytyann/OpenWrt-mihomo/releases/latest | grep -oP '"browser_download_url":\s*".*mihomo_x86_64-openwrt-24.10.tar.gz"' | cut -d '"' -f 4) - tar --one-top-level=mihomo_aarch64_cortex-a53-openwrt-24.10 -xvzf mihomo_aarch64_cortex-a53-openwrt-24.10.tar.gz - tar --one-top-level=mihomo_x86_64-openwrt-24.10 -xvzf mihomo_x86_64-openwrt-24.10.tar.gz - - - name: Organize files for aarch64_cortex-a53&x86_64 - run: | - mkdir mihomo_x86_64 mihomo_aarch64_cortex-a53 - cp mihomo_x86_64-openwrt-24.10/*.ipk mihomo_x86_64/ - cp mihomo_aarch64_cortex-a53-openwrt-24.10/*.ipk mihomo_aarch64_cortex-a53/ - - - - name: Create install.sh scripts - run: | - cat < mihomo_x86_64/install.sh - #!/bin/sh - opkg update - if [ $? -ne 0 ]; then - echo "update failed。" - exit 1 - fi - opkg install *.ipk - EOF - chmod +x mihomo_x86_64/install.sh - cp mihomo_x86_64/install.sh mihomo_aarch64_cortex-a53/install.sh - - - - name: Move mihomo directories to makeself - run: | - mv mihomo_x86_64 makeself/ - mv mihomo_aarch64_cortex-a53 makeself/ - - - name: Create self-extracting packages - run: | - cd makeself - ./makeself.sh mihomo_x86_64/ mihomo_${{ env.LATEST_TAG }}_x86_64.run "by github action" ./install.sh - ./makeself.sh mihomo_aarch64_cortex-a53/ mihomo_${{ env.LATEST_TAG }}_aarch64_cortex-a53.run "by github action" ./install.sh - - - - name: Check file sizes - run: | - ls -lh makeself/mihomo_*.run - - - name: Fetch latest release details - id: fetch_release_details - run: | - extra_content="![Github](https://img.shields.io/badge/mihomo.run-123456?logo=github&logoColor=fff&labelColor=yellow&style=for-the-badge) [![Github](https://img.shields.io/badge/国内加速站下载-FC7C0D?logo=github&logoColor=fff&labelColor=000&style=for-the-badge)](https://wkdaily.cpolar.top/archives/1) ![GitHub Downloads (all assets, specific tag)](https://img.shields.io/github/downloads/wukongdaily/RunFilesBuilder/${{ env.LATEST_TAG }}/total?style=for-the-badge&labelColor=black&color=%2325c2a0)" - sed -i "1i$extra_content" "${{ github.workspace }}/info.md" - - - name: Print release notes - run: | - cat ${{ github.workspace }}/info.md - - - name: Generate new tag & release - uses: softprops/action-gh-release@v2.1.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ env.LATEST_TAG }} - target_commitish: ${{ github.ref_name }} - prerelease: false - body_path: ${{ github.workspace }}/info.md - - - name: Upload run files as release assets - uses: softprops/action-gh-release@v2.1.0 - with: - tag_name: ${{ env.LATEST_TAG }} - name: "mihomo-${{ env.LATEST_TAG }}" - files: makeself/mihomo_*.run - token: ${{ secrets.GITHUB_TOKEN }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/nikki.yml b/.github/workflows/nikki.yml new file mode 100644 index 0000000..48c2efc --- /dev/null +++ b/.github/workflows/nikki.yml @@ -0,0 +1,106 @@ +#================================================= +# https://github.com/wukongdaily/RunFilesBuilder +# Description: Build RunFiles using GitHub Actions +# Lisence: MIT +# Author: wukongdaily +# Blog: wkdaily.cpolar.top +#================================================= + +name: Make nikki run files for 23.05 + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Fetch latest release tag from nikki + id: fetch_latest_tag + run: | + latest_tag=$(curl -s https://api.github.com/repos/nikkinikki-org/OpenWrt-nikki/releases/latest | jq -r '.tag_name') + + echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV + # https://github.com/nikkinikki-org/OpenWrt-nikki/releases/download/v1.17.5/nikki_aarch64_cortex-a53-openwrt-23.05.tar.gz + + - name: Clone makeself repository + run: git clone https://github.com/megastep/makeself.git + + - name: Download latest nikki files + run: | + curl -LO $(curl -s https://api.github.com/repos/nikkinikki-org/OpenWrt-nikki/releases/latest | grep -oP '"browser_download_url":\s*".*nikki_aarch64_cortex-a53-openwrt-24.10.tar.gz"' | cut -d '"' -f 4) + curl -LO $(curl -s https://api.github.com/repos/nikkinikki-org/OpenWrt-nikki/releases/latest | grep -oP '"browser_download_url":\s*".*nikki_x86_64-openwrt-24.10.tar.gz"' | cut -d '"' -f 4) + tar --one-top-level=nikki_aarch64_cortex-a53-openwrt-24.10 -xvzf nikki_aarch64_cortex-a53-openwrt-24.10.tar.gz + tar --one-top-level=nikki_x86_64-openwrt-24.10 -xvzf nikki_x86_64-openwrt-24.10.tar.gz + + - name: Organize files for aarch64_cortex-a53&x86_64 + run: | + mkdir nikki_x86_64 nikki_aarch64_cortex-a53 + cp nikki_x86_64-openwrt-24.10/*.ipk nikki_x86_64/ + cp nikki_aarch64_cortex-a53-openwrt-24.10/*.ipk nikki_aarch64_cortex-a53/ + + + - name: Create install.sh scripts + run: | + cat < nikki_x86_64/install.sh + #!/bin/sh + opkg update + if [ $? -ne 0 ]; then + echo "update failed。" + exit 1 + fi + opkg install *.ipk + EOF + chmod +x nikki_x86_64/install.sh + cp nikki_x86_64/install.sh nikki_aarch64_cortex-a53/install.sh + + + - name: Move nikki directories to makeself + run: | + mv nikki_x86_64 makeself/ + mv nikki_aarch64_cortex-a53 makeself/ + + - name: Create self-extracting packages + run: | + cd makeself + ./makeself.sh nikki_x86_64/ nikki_${{ env.LATEST_TAG }}_x86_64.run "by github action" ./install.sh + ./makeself.sh nikki_aarch64_cortex-a53/ nikki_${{ env.LATEST_TAG }}_aarch64_cortex-a53.run "by github action" ./install.sh + + + - name: Check file sizes + run: | + ls -lh makeself/nikki_*.run + + - name: Fetch latest release details + id: fetch_release_details + run: | + extra_content="![Github](https://img.shields.io/badge/nikki.run-123456?logo=github&logoColor=fff&labelColor=yellow&style=for-the-badge) [![Github](https://img.shields.io/badge/国内加速站下载-FC7C0D?logo=github&logoColor=fff&labelColor=000&style=for-the-badge)](https://wkdaily.cpolar.top/archives/1) ![GitHub Downloads (all assets, specific tag)](https://img.shields.io/github/downloads/wukongdaily/RunFilesBuilder/${{ env.LATEST_TAG }}/total?style=for-the-badge&labelColor=black&color=%2325c2a0)" + sed -i "1i$extra_content" "${{ github.workspace }}/info.md" + + - name: Print release notes + run: | + cat ${{ github.workspace }}/info.md + + - name: Generate new tag & release + uses: softprops/action-gh-release@v2.1.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.LATEST_TAG }} + target_commitish: ${{ github.ref_name }} + prerelease: false + body_path: ${{ github.workspace }}/info.md + + - name: Upload run files as release assets + uses: softprops/action-gh-release@v2.1.0 + with: + tag_name: ${{ env.LATEST_TAG }} + name: "nikki-${{ env.LATEST_TAG }}" + files: makeself/nikki_*.run + token: ${{ secrets.GITHUB_TOKEN }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}