ci: test publish #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| permissions: | |
| contents: write | |
| on: | |
| push: | |
| branches: | |
| - ci | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| cpu: [ x64, x86 ] | |
| kind: [ zip ] | |
| trimmed: [ true, false ] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 6.0.x | |
| 8.0.x | |
| - name: Install Pupnet | |
| run: | | |
| dotnet tool install -g KuiperZone.PupNet | |
| - name: Get Deps | |
| run: | | |
| .\ffmpeg.ps1 ${{ matrix.cpu }} | |
| .\aria2.ps1 ${{ matrix.cpu }} | |
| working-directory: ./script | |
| - name: Package | |
| if: ${{ matrix.trimmed == false }} | |
| run: | | |
| pupnet DownKyi.pupnet.conf --app-version 999.999.999 --kind ${{ matrix.kind }} -r win-${{ matrix.cpu }} -y | |
| working-directory: ./script/pupnet | |
| - name: Package trimmed | |
| if: ${{ matrix.trimmed == true }} | |
| run: | | |
| pupnet DownKyi.pupnet.trimmed.conf --app-version 999.999.999 --kind ${{ matrix.kind }} -r win-${{ matrix.cpu }} -y | |
| mv output/DownKyi-999.999.999-1.win-${{ matrix.cpu }}.${{ matrix.kind }} output/DownKyi-999.999.999-1.win-${{ matrix.cpu }}-trimmed.${{ matrix.kind }} | |
| working-directory: ./script/pupnet | |
| - name: Upload build artifacts ${{ matrix.kind }} | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ matrix.trimmed == false }} | |
| with: | |
| name: DownKyi-999.999.999-1.win-${{ matrix.cpu }}.${{ matrix.kind }} | |
| path: script/pupnet/output/DownKyi-999.999.999-1.win-${{ matrix.cpu }}.${{ matrix.kind }} | |
| - name: Upload build artifacts ${{ matrix.kind }} trimmed | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ matrix.trimmed == true }} | |
| with: | |
| name: DownKyi-999.999.999-1.win-${{ matrix.cpu }}-trimmed.${{ matrix.kind }} | |
| path: script/pupnet/output/DownKyi-999.999.999-1.win-${{ matrix.cpu }}-trimmed.${{ matrix.kind }} | |
| build-linux: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| cpu: [ x64, arm64 ] | |
| kind: [ AppImage, deb, rpm ] | |
| type: [ self-contained ] | |
| include: | |
| - kind: AppImage | |
| cpu: x64 | |
| package-tail: .x86_64 | |
| package-head: DownKyi- | |
| - kind: deb | |
| cpu: x64 | |
| package-tail: _amd64 | |
| package-head: downkyi_ | |
| - kind: rpm | |
| cpu: x64 | |
| package-tail: .x86_64 | |
| package-head: downkyi_ | |
| - kind: AppImage | |
| cpu: arm64 | |
| package-tail: .aarch64 | |
| package-head: DownKyi- | |
| - kind: deb | |
| cpu: arm64 | |
| package-tail: _arm64 | |
| package-head: downkyi_ | |
| exclude: | |
| - kind: rpm | |
| cpu: arm64 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 6.0.x | |
| 8.0.x | |
| - name: Install Pupnet | |
| run: | | |
| dotnet tool install -g KuiperZone.PupNet | |
| sudo apt update | |
| sudo apt install libfuse2 | |
| - name: Get Deps | |
| run: | | |
| chmod +x ffmpeg.sh | |
| chmod +x aria2.sh | |
| ./ffmpeg.sh linux ${{ matrix.cpu }} | |
| ./aria2.sh linux-${{ matrix.cpu }} | |
| working-directory: ./script | |
| - name: Package | |
| run: | | |
| pupnet DownKyi.pupnet.conf --app-version 999.999.999 --kind ${{ matrix.kind }} -r linux-${{ matrix.cpu }} -y | |
| working-directory: ./script/pupnet | |
| - name: Upload build artifacts ${{ matrix.kind }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.package-head }}999.999.999_linux_${{ matrix.type }}${{ matrix.package-tail }}.${{ matrix.kind }} | |
| path: script/pupnet/output/${{ matrix.package-head }}999.999.999-1${{ matrix.package-tail }}.${{ matrix.kind }} | |
| - name: Change Name | |
| if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
| 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 }}" | |
| working-directory: ./script/pupnet/output/ | |
| build-macos: | |
| runs-on: macos-latest | |
| strategy: | |
| matrix: | |
| cpu: [ x64, arm64 ] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 6.0.x | |
| 8.0.x | |
| - name: Get Deps | |
| run: | | |
| chmod +x aria2.sh | |
| chmod +x ffmpeg.sh | |
| ./aria2.sh osx-${{ matrix.cpu }} | |
| ./ffmpeg.sh mac ${{ matrix.cpu }} | |
| working-directory: ./script | |
| - name: Build ${{ matrix.cpu }} | |
| run: | | |
| dotnet restore | |
| dotnet publish DownKyi/DownKyi.csproj --self-contained -r osx-${{ matrix.cpu }} -c Release -p:DebugType=None -p:DebugSymbols=false | |
| - name: Package app | |
| run: | | |
| chmod +x package.sh | |
| ./package.sh ${{ matrix.cpu }} | |
| working-directory: ./script/macos |