Skip to content

Merge pull request #29 from adel-bakhshi/develop #15

Merge pull request #29 from adel-bakhshi/develop

Merge pull request #29 from adel-bakhshi/develop #15

Workflow file for this run

name: Build and Release CDM
on:
push:
tags:
- "v*"
jobs:
setup:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
env:
currVer: ${{ github.ref_name }}
steps:
- name: Extract Version Number
id: get_version
shell: bash
run: |
version="${currVer#v}"
echo "version=$version" >> $GITHUB_OUTPUT
echo "Extracted version: $version"
build-windows:
needs: setup
runs-on: windows-latest
strategy:
matrix:
rid: ["win-x64", "win-arm64"]
steps:
- name: Checkout Repository
uses: actions/checkout@v5
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.x.x
- name: Install Inno Setup
run: choco install innosetup -y
- name: Install Pupnet Deploy
run: dotnet tool install -g KuiperZone.PupNet --version 1.8.*
- name: Restore Dependencies
run: dotnet restore
- name: Build Windows EXE File
run: pupnet -k setup -r ${{ matrix.rid }} -y -o "Cross-platform.Download.Manager.${{ needs.setup.outputs.version }}.${{ matrix.rid }}.exe"
- name: Build Windows ZIP Portable
run: pupnet -k zip -r ${{ matrix.rid }} -y -o "Cross-platform.Download.Manager.${{ needs.setup.outputs.version }}.${{ matrix.rid }}.zip"
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Windows-${{ matrix.rid }}-Packages
path: ./Deploy/bin/*
build-linux:
needs: setup
runs-on: ubuntu-latest
strategy:
matrix:
rid: ["linux-x64", "linux-arm64"]
steps:
- name: Checkout Repository
uses: actions/checkout@v5
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.x.x
- name: Install Dependencies
run: |
sudo apt update
sudo apt-get install -y zip rpm zstd fuse libfuse2
- name: Install x86_64 AppImageTool
if: matrix.rid == 'linux-x64'
run: |
wget https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x ./appimagetool-x86_64.AppImage
echo "$PWD" >> $GITHUB_PATH
- name: Install arm64 AppImageTool
if: matrix.rid == 'linux-arm64'
run: |
wget https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-aarch64.AppImage
chmod +x ./appimagetool-aarch64.AppImage
echo "$PWD" >> $GITHUB_PATH
- name: Install Pupnet Deploy
run: dotnet tool install -g KuiperZone.PupNet --version 1.8.*
- name: Restore Dependencies
run: dotnet restore
- name: Build Linux DEB File
run: pupnet -k deb -r ${{ matrix.rid }} -y -o "Cross-platform.Download.Manager.${{ needs.setup.outputs.version }}.${{ matrix.rid }}.deb"
# Building RPM package for arm64 architecture with PupNet Deploy is failing, so I couldn't build RPM package for now.
- name: Build Linux RPM File
if: matrix.rid == 'linux-x64'
run: pupnet -k rpm -r ${{ matrix.rid }} -y -o "Cross-platform.Download.Manager.${{ needs.setup.outputs.version }}.${{ matrix.rid }}.rpm"
- name: Build AppImage File
run: pupnet -k appimage -r ${{ matrix.rid }} -y -o "Cross-platform.Download.Manager.${{ needs.setup.outputs.version }}.${{ matrix.rid }}.AppImage"
# - name: Build Linux DEB File
# run: chmod +x ./Deploy/linux/deb/process.sh && ./Deploy/linux/deb/process.sh
# - name: Build Linux RPM File
# run: chmod +x ./Deploy/linux/rpm/process-on-deb.sh && ./Deploy/linux/rpm/process-on-deb.sh
# - name: Build AppImage File
# run: chmod +x ./Deploy/linux/appimage/process.sh && ./Deploy/linux/appimage/process.sh
# - name: Build Linux ZIP Portable
# run: chmod +x ./Deploy/linux/tarball/process.sh && ./Deploy/linux/tarball/process.sh
- name: Build Linux ZIP Portable
run: |
chmod +x ./Deploy/linux/tarball/process.sh
./Deploy/linux/tarball/process.sh ${{ matrix.rid }} ${{ needs.setup.outputs.version }}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Linux-${{ matrix.rid }}-Packages
path: ./Deploy/bin/*
build-macos:
needs: setup
runs-on: macos-latest
strategy:
matrix:
rid: ["osx-x64", "osx-arm64"]
steps:
- name: Checkout Repository
uses: actions/checkout@v5
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.x.x
- name: Restore Dependencies
run: dotnet restore
- name: Build macOS App Bundle
run: |
chmod +x ./Deploy/macos/app/process.sh
./Deploy/macos/app/process.sh ${{ matrix.rid }} ${{ needs.setup.outputs.version }}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: macOS-${{ matrix.rid }}-Packages
path: ./Deploy/bin/*
release:
needs: [setup, build-windows, build-linux, build-macos]
runs-on: ubuntu-latest
steps:
- name: Download Windows x64 Artifacts
uses: actions/download-artifact@v4
with:
name: Windows-win-x64-Packages
path: artifacts/
- name: Download Windows ARM64 Artifacts
uses: actions/download-artifact@v4
with:
name: Windows-win-arm64-Packages
path: artifacts/
- name: Download Linux x64 Artifacts
uses: actions/download-artifact@v4
with:
name: Linux-linux-x64-Packages
path: artifacts/
- name: Download Linux ARM64 Artifacts
uses: actions/download-artifact@v4
with:
name: Linux-linux-arm64-Packages
path: artifacts/
- name: Download macOS x64 Artifacts
uses: actions/download-artifact@v4
with:
name: macOS-osx-x64-Packages
path: artifacts/
- name: Download macOS ARM64 Artifacts
uses: actions/download-artifact@v4
with:
name: macOS-osx-arm64-Packages
path: artifacts/
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: Cross platform Download Manager ${{ github.ref_name }}
files: artifacts/*
token: ${{ secrets.GITHUB_TOKEN }}