|
| 1 | +name: Build |
| 2 | + |
| 3 | +permissions: |
| 4 | + contents: write |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - ci |
| 10 | + |
| 11 | +jobs: |
| 12 | + build-windows: |
| 13 | + runs-on: windows-latest |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + cpu: [ x64, x86 ] |
| 17 | + kind: [ zip ] |
| 18 | + trimmed: [ true, false ] |
| 19 | + steps: |
| 20 | + - name: Checkout |
| 21 | + uses: actions/checkout@v4 |
| 22 | + - name: Install .NET |
| 23 | + uses: actions/setup-dotnet@v4 |
| 24 | + with: |
| 25 | + dotnet-version: | |
| 26 | + 6.0.x |
| 27 | + 8.0.x |
| 28 | + - name: Install Pupnet |
| 29 | + run: | |
| 30 | + dotnet tool install -g KuiperZone.PupNet |
| 31 | + - name: Get Deps |
| 32 | + run: | |
| 33 | + .\ffmpeg.ps1 ${{ matrix.cpu }} |
| 34 | + .\aria2.ps1 ${{ matrix.cpu }} |
| 35 | + working-directory: ./script |
| 36 | + - name: Package |
| 37 | + if: ${{ matrix.trimmed == false }} |
| 38 | + run: | |
| 39 | + pupnet DownKyi.pupnet.conf --app-version 999.999.999 --kind ${{ matrix.kind }} -r win-${{ matrix.cpu }} -y |
| 40 | + working-directory: ./script/pupnet |
| 41 | + - name: Package trimmed |
| 42 | + if: ${{ matrix.trimmed == true }} |
| 43 | + run: | |
| 44 | + pupnet DownKyi.pupnet.trimmed.conf --app-version 999.999.999 --kind ${{ matrix.kind }} -r win-${{ matrix.cpu }} -y |
| 45 | + mv output/DownKyi-999.999.999-1.win-${{ matrix.cpu }}.${{ matrix.kind }} output/DownKyi-999.999.999-1.win-${{ matrix.cpu }}-trimmed.${{ matrix.kind }} |
| 46 | + working-directory: ./script/pupnet |
| 47 | + - name: Upload build artifacts ${{ matrix.kind }} |
| 48 | + uses: actions/upload-artifact@v4 |
| 49 | + if: ${{ matrix.trimmed == false }} |
| 50 | + with: |
| 51 | + name: DownKyi-999.999.999-1.win-${{ matrix.cpu }}.${{ matrix.kind }} |
| 52 | + path: script/pupnet/output/DownKyi-999.999.999-1.win-${{ matrix.cpu }}.${{ matrix.kind }} |
| 53 | + - name: Upload build artifacts ${{ matrix.kind }} trimmed |
| 54 | + uses: actions/upload-artifact@v4 |
| 55 | + if: ${{ matrix.trimmed == true }} |
| 56 | + with: |
| 57 | + name: DownKyi-999.999.999-1.win-${{ matrix.cpu }}-trimmed.${{ matrix.kind }} |
| 58 | + path: script/pupnet/output/DownKyi-999.999.999-1.win-${{ matrix.cpu }}-trimmed.${{ matrix.kind }} |
| 59 | + build-linux: |
| 60 | + runs-on: ubuntu-22.04 |
| 61 | + strategy: |
| 62 | + matrix: |
| 63 | + cpu: [ x64, arm64 ] |
| 64 | + kind: [ AppImage, deb, rpm ] |
| 65 | + type: [ self-contained ] |
| 66 | + include: |
| 67 | + - kind: AppImage |
| 68 | + cpu: x64 |
| 69 | + package-tail: .x86_64 |
| 70 | + package-head: DownKyi- |
| 71 | + - kind: deb |
| 72 | + cpu: x64 |
| 73 | + package-tail: _amd64 |
| 74 | + package-head: downkyi_ |
| 75 | + - kind: rpm |
| 76 | + cpu: x64 |
| 77 | + package-tail: .x86_64 |
| 78 | + package-head: downkyi_ |
| 79 | + - kind: AppImage |
| 80 | + cpu: arm64 |
| 81 | + package-tail: .aarch64 |
| 82 | + package-head: DownKyi- |
| 83 | + - kind: deb |
| 84 | + cpu: arm64 |
| 85 | + package-tail: _arm64 |
| 86 | + package-head: downkyi_ |
| 87 | + exclude: |
| 88 | + - kind: rpm |
| 89 | + cpu: arm64 |
| 90 | + steps: |
| 91 | + - name: Checkout |
| 92 | + uses: actions/checkout@v4 |
| 93 | + - name: Install .NET |
| 94 | + uses: actions/setup-dotnet@v4 |
| 95 | + dotnet-version: | |
| 96 | + 6.0.x |
| 97 | + 8.0.x |
| 98 | + - name: Install Pupnet |
| 99 | + run: | |
| 100 | + dotnet tool install -g KuiperZone.PupNet |
| 101 | + sudo apt update |
| 102 | + sudo apt install libfuse2 |
| 103 | + - name: Get Deps |
| 104 | + run: | |
| 105 | + chmod +x ffmpeg.sh |
| 106 | + chmod +x aria2.sh |
| 107 | + ./ffmpeg.sh linux ${{ matrix.cpu }} |
| 108 | + ./aria2.sh linux-${{ matrix.cpu }} |
| 109 | + working-directory: ./script |
| 110 | + - name: Package |
| 111 | + run: | |
| 112 | + pupnet DownKyi.pupnet.conf --app-version 999.999.999 --kind ${{ matrix.kind }} -r linux-${{ matrix.cpu }} -y |
| 113 | + working-directory: ./script/pupnet |
| 114 | + - name: Upload build artifacts ${{ matrix.kind }} |
| 115 | + uses: actions/upload-artifact@v4 |
| 116 | + with: |
| 117 | + name: ${{ matrix.package-head }}999.999.999_linux_${{ matrix.type }}${{ matrix.package-tail }}.${{ matrix.kind }} |
| 118 | + path: script/pupnet/output/${{ matrix.package-head }}999.999.999-1${{ matrix.package-tail }}.${{ matrix.kind }} |
| 119 | + - name: Change Name |
| 120 | + if: ${{ startsWith(github.ref, 'refs/tags/') }} |
| 121 | + run: mv "${{ matrix.package-head }}999.999.999-1${{ matrix.package-tail }}.${{ matrix.kind }}" "${{ matrix.package-head }}999.999.999_linux_${{ matrix.type }}${{ matrix.package-tail }}.${{ matrix.kind }}" |
| 122 | + working-directory: ./script/pupnet/output/ |
| 123 | + build-macos: |
| 124 | + runs-on: macos-latest |
| 125 | + strategy: |
| 126 | + matrix: |
| 127 | + cpu: [ x64, arm64 ] |
| 128 | + steps: |
| 129 | + - name: Checkout |
| 130 | + uses: actions/checkout@v4 |
| 131 | + - name: Install .NET |
| 132 | + uses: actions/setup-dotnet@v4 |
| 133 | + with: |
| 134 | + dotnet-version: | |
| 135 | + 6.0.x |
| 136 | + 8.0.x |
| 137 | + - name: Get Deps |
| 138 | + run: | |
| 139 | + chmod +x aria2.sh |
| 140 | + chmod +x ffmpeg.sh |
| 141 | + ./aria2.sh osx-${{ matrix.cpu }} |
| 142 | + ./ffmpeg.sh mac ${{ matrix.cpu }} |
| 143 | + working-directory: ./script |
| 144 | + - name: Build ${{ matrix.cpu }} |
| 145 | + run: | |
| 146 | + dotnet restore |
| 147 | + dotnet publish DownKyi/DownKyi.csproj --self-contained -r osx-${{ matrix.cpu }} -c Release -p:DebugType=None -p:DebugSymbols=false |
| 148 | + - name: Package app |
| 149 | + run: | |
| 150 | + chmod +x package.sh |
| 151 | + ./package.sh ${{ matrix.cpu }} |
| 152 | + working-directory: ./script/macos |
0 commit comments