|
8 | 8 | - "v*.*.*"
|
9 | 9 | workflow_dispatch:
|
10 | 10 |
|
| 11 | +permissions: |
| 12 | + contents: write |
| 13 | + |
11 | 14 | jobs:
|
12 |
| - build: |
| 15 | + build-common-archs: |
13 | 16 | runs-on: ${{ matrix.os }}
|
14 |
| - permissions: |
15 |
| - contents: write |
16 | 17 | strategy:
|
17 | 18 | matrix:
|
18 | 19 | include:
|
|
64 | 65 | asset_name: ${{ matrix.filename }}
|
65 | 66 | tag: ${{ github.ref }}
|
66 | 67 | file_glob: false
|
| 68 | + |
| 69 | + build-extra-archs: |
| 70 | + runs-on: ubuntu-latest |
| 71 | + strategy: |
| 72 | + matrix: |
| 73 | + include: |
| 74 | + - target: aarch64-unknown-linux-gnu |
| 75 | + filename: downapk-linux-aarch64 |
| 76 | + - target: aarch64-linux-android |
| 77 | + filename: downapk-android-aarch64 |
| 78 | + - target: armv7-unknown-linux-gnueabihf |
| 79 | + filename: downapk-linux-armv7 |
| 80 | + - target: armv7-linux-androideabi |
| 81 | + filename: downapk-android-armv7 |
| 82 | + - target: x86_64-linux-android |
| 83 | + filename: downapk-android-x86_64 |
| 84 | + - target: i686-unknown-linux-gnu |
| 85 | + filename: downapk-linux-i686 |
| 86 | + |
| 87 | + steps: |
| 88 | + - name: Checkout code |
| 89 | + uses: actions/checkout@v4 |
| 90 | + |
| 91 | + - name: Setup Rust |
| 92 | + run: | |
| 93 | + rustup update --no-self-update stable |
| 94 | + rustup component add --toolchain stable rustfmt rust-src |
| 95 | + rustup default stable |
| 96 | +
|
| 97 | + - name: Setup Cache |
| 98 | + uses: actions/cache@v4 |
| 99 | + env: |
| 100 | + cache-name: cache-cargo-${{ matrix.target }} |
| 101 | + with: |
| 102 | + path: | |
| 103 | + ~/.cargo |
| 104 | + key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }} |
| 105 | + restore-keys: | |
| 106 | + ${{ runner.os }}-cargo-${{ matrix.target }}- |
| 107 | +
|
| 108 | + - name: Install dependencies |
| 109 | + run: | |
| 110 | + cargo install cross --git https://github.com/cross-rs/cross |
| 111 | +
|
| 112 | + - name: Build ${{ matrix.target }} |
| 113 | + run: cross build --release --target ${{ matrix.target }} |
| 114 | + |
| 115 | + - name: Upload unix-like binaries to release |
| 116 | + uses: svenstaro/upload-release-action@v2 |
| 117 | + if: contains(matrix.target, 'windows') == false |
| 118 | + with: |
| 119 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 120 | + file: target/${{ matrix.target }}/release/downapk |
| 121 | + asset_name: ${{ matrix.filename }} |
| 122 | + tag: ${{ github.ref }} |
| 123 | + file_glob: false |
0 commit comments