|
| 1 | +name: Build and Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - "*" |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - "*" |
| 10 | + release: |
| 11 | + types: |
| 12 | + - released |
| 13 | + |
| 14 | +jobs: |
| 15 | + appimage: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + container: "ubuntu:20.04" |
| 18 | + steps: |
| 19 | + - name: Checkout |
| 20 | + uses: actions/checkout@v4 |
| 21 | + - uses: actions/cache@v4 |
| 22 | + with: |
| 23 | + path: | |
| 24 | + /usr/src/ |
| 25 | + /var/cache/apt/ |
| 26 | + key: appimage-build-dependencies-cache-${{ github.sha }} |
| 27 | + restore-keys: | |
| 28 | + appimage-build-dependencies-cache- |
| 29 | + - name: Build AppImage |
| 30 | + run: .github/workflows/build_appimage.sh |
| 31 | + - uses: actions/upload-artifact@v4 |
| 32 | + with: |
| 33 | + name: qBittorrent-Enhanced-Edition-x86_64.AppImage |
| 34 | + path: ".github/workflows/qBittorrent-Enhanced-Edition*.AppImage*" |
| 35 | + - name: Upload Github Assets |
| 36 | + if: startsWith(github.ref, 'refs/tags/') |
| 37 | + uses: svenstaro/upload-release-action@v2 |
| 38 | + with: |
| 39 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 40 | + file: ".github/workflows/qBittorrent-Enhanced-Edition*.AppImage*" |
| 41 | + tag: ${{ github.ref }} |
| 42 | + overwrite: true |
| 43 | + file_glob: true |
| 44 | + |
| 45 | + # cross compile for some other platforms, like arm, mips, etc. |
| 46 | + cross-compile: |
| 47 | + runs-on: ubuntu-latest |
| 48 | + container: "abcfy2/muslcc-toolchain-ubuntu:${{ matrix.cross_host }}" |
| 49 | + strategy: |
| 50 | + fail-fast: false |
| 51 | + matrix: |
| 52 | + cross_host: |
| 53 | + # cross toolchain downloads from: https://musl.cc/ |
| 54 | + # you need to find the name ${cross_host}-cross.tgz |
| 55 | + - arm-linux-musleabi |
| 56 | + - arm-linux-musleabihf |
| 57 | + - aarch64-linux-musl |
| 58 | + - mips-linux-musl |
| 59 | + - mipsel-linux-musl |
| 60 | + - mips64-linux-musl |
| 61 | + - mips64el-linux-musl |
| 62 | + - x86_64-linux-musl |
| 63 | + - i686-linux-musl |
| 64 | + steps: |
| 65 | + - name: Checkout |
| 66 | + uses: actions/checkout@v4 |
| 67 | + - uses: actions/cache@v4 |
| 68 | + with: |
| 69 | + path: | |
| 70 | + /usr/src/ |
| 71 | + /var/cache/apt/ |
| 72 | + key: cross-build-dependencies-cache-${{ matrix.cross_host }}-${{ github.sha }} |
| 73 | + restore-keys: | |
| 74 | + cross-build-dependencies-cache-${{ matrix.cross_host }}- |
| 75 | + - name: cross compile nox-static |
| 76 | + env: |
| 77 | + CROSS_HOST: "${{ matrix.cross_host }}" |
| 78 | + run: .github/workflows/cross_build.sh |
| 79 | + - uses: actions/upload-artifact@v4 |
| 80 | + with: |
| 81 | + name: qbittorrent-enhanced-nox_${{ matrix.cross_host }}_static |
| 82 | + path: | |
| 83 | + /tmp/qbittorrent-nox* |
| 84 | + - name: Upload Github Assets |
| 85 | + if: startsWith(github.ref, 'refs/tags/') |
| 86 | + uses: svenstaro/upload-release-action@v2 |
| 87 | + with: |
| 88 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 89 | + file: ".github/workflows/qbittorrent-enhanced-nox_${{ matrix.cross_host }}_static.zip" |
| 90 | + tag: ${{ github.ref }} |
| 91 | + overwrite: true |
0 commit comments