diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 21cafcd..abc043b 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -5,6 +5,7 @@ on: branches: [ main ] tags: [ 'v*' ] pull_request: + workflow_dispatch: jobs: macos: @@ -190,11 +191,70 @@ jobs: run: | rm -rf target/${{ matrix.platform.target }}/debian rm -rf target/${{ matrix.platform.target }}/generate-rpm - + + linux-others: + runs-on: ubuntu-latest + strategy: + matrix: + platform: + - target: "armv5te-unknown-linux-musleabi" + image_tag: "armv5te-musleabi" + cargo_extra_args: --no-default-features --features rustls-tls + - target: "mips-unknown-linux-musl" + image_tag: "mips-musl" + cargo_extra_args: --no-default-features --features native-tls-vendored + - target: "mipsel-unknown-linux-musl" + image_tag: "mipsel-musl" + cargo_extra_args: --no-default-features --features native-tls-vendored + container: + image: docker://messense/rust-musl-cross:${{ matrix.platform.image_tag }} + steps: + - uses: actions/checkout@v2 + - name: Cache cargo build + uses: Swatinem/rust-cache@v1 + with: + key: ${{ matrix.platform.target }} + - name: Build + env: + RUSTFLAGS: -C target-feature=+crt-static -C link-arg=-s + run: | + cargo build --release --target ${{ matrix.platform.target }} ${{ matrix.platform.cargo_extra_args }} + - name: Upx compress binary + uses: crazy-max/ghaction-upx@v1 + with: + version: v3.95 # v3.96 breaks mipsel, https://github.com/upx/upx/issues/504 + files: target/${{ matrix.platform.target }}/release/aliyundrive-fuse + - name: Upload binary artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.platform.target }}-bin + path: target/${{ matrix.platform.target }}/release/aliyundrive-fuse + if-no-files-found: error + - name: Get tag + if: "startsWith(github.ref, 'refs/tags/')" + id: tag + uses: dawidd6/action-get-tag@v1 + - name: Archive binary + if: "startsWith(github.ref, 'refs/tags/')" + run: | + cd target/${{ matrix.platform.target }}/release + tar czvf aliyundrive-fuse-${{ steps.tag.outputs.tag }}.${{ matrix.platform.target }}.tar.gz aliyundrive-fuse + shasum -a 256 aliyundrive-fuse-${{ steps.tag.outputs.tag }}.${{ matrix.platform.target }}.tar.gz > aliyundrive-fuse-${{ steps.tag.outputs.tag }}.${{ matrix.platform.target }}.tar.gz.sha256 + cd - + - name: Upload binary to GitHub Release + uses: svenstaro/upload-release-action@v2 + if: "startsWith(github.ref, 'refs/tags/')" + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: target/${{ matrix.platform.target }}/release/aliyundrive-fuse*.tar.gz* + file_glob: true + overwrite: true + tag: ${{ github.ref }} + openwrt: name: OpenWrt Package - ${{ matrix.target.arch }} runs-on: ubuntu-latest - needs: [ linux ] + needs: [ linux, linux-others ] environment: OpenWrt strategy: matrix: @@ -211,8 +271,16 @@ jobs: sdk: "https://downloads.openwrt.org/snapshots/targets/x86/64/openwrt-sdk-x86-64_gcc-11.2.0_musl.Linux-x86_64.tar.xz" - arch: "i386_pentium4" sdk: "https://downloads.openwrt.org/snapshots/targets/x86/generic/openwrt-sdk-x86-generic_gcc-11.2.0_musl.Linux-x86_64.tar.xz" + - arch: "arm_mpcore" + sdk: "https://downloads.openwrt.org/snapshots/targets/oxnas/ox820/openwrt-sdk-oxnas-ox820_gcc-11.2.0_musl_eabi.Linux-x86_64.tar.xz" + - arch: "arm_cortex-a5_vfpv4" + sdk: "https://downloads.openwrt.org/snapshots/targets/at91/sama5/openwrt-sdk-at91-sama5_gcc-11.2.0_musl_eabi.Linux-x86_64.tar.xz" - arch: "arm_cortex-a7_neon-vfpv4" sdk: "https://downloads.openwrt.org/snapshots/targets/ipq40xx/generic/openwrt-sdk-ipq40xx-generic_gcc-11.2.0_musl_eabi.Linux-x86_64.tar.xz" + - arch: "mipsel_24kc" + sdk: "https://downloads.openwrt.org/snapshots/targets/ramips/mt7621/openwrt-sdk-ramips-mt7621_gcc-11.2.0_musl.Linux-x86_64.tar.xz" + - arch: "mips_24kc" + sdk: "https://archive.openwrt.org/releases/19.07.7/targets/ar71xx/nand/openwrt-sdk-19.07.7-ar71xx-nand_gcc-7.5.0_musl.Linux-x86_64.tar.xz" steps: - uses: actions/checkout@v2 - name: Install build requirements @@ -237,9 +305,11 @@ jobs: cd openwrt-sdk cat feeds.conf.default >> feeds.conf cat feeds.conf + ./scripts/feeds update -a > /dev/null make defconfig - ./scripts/feeds install -d y -p "aliyundrive" -f -a + + ./scripts/feeds install -d y -f -a make package/aliyundrive-fuse/compile V=s make package/luci-app-aliyundrive-fuse/compile V=s tree bin/packages/