FreeDATA/.github/workflows/build_server.yml

124 lines
4.2 KiB
YAML
Raw Normal View History

2023-12-31 12:23:48 +00:00
name: build_server
2023-12-31 12:22:54 +00:00
on: [push]
jobs:
build_i686_x64_release:
name: Build FreeDATA packages
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
2024-04-17 21:37:28 +00:00
os: [ubuntu-20.04, windows-latest] # removed macos-latest as it's broken for now
2023-12-31 12:22:54 +00:00
include:
- os: ubuntu-20.04
2024-01-15 15:27:53 +00:00
zip_name: freedata-server_ubuntu
2023-12-31 12:22:54 +00:00
generator: Unix Makefiles
2024-04-18 09:04:25 +00:00
modem_binary_name: freedata_server
2023-12-31 12:22:54 +00:00
2024-04-19 08:04:06 +00:00
#- os: macos-latest
# zip_name: freedata-server_macos
# generator: Unix Makefiles
# modem_binary_name: freedata_server
2023-12-31 12:22:54 +00:00
- os: windows-latest
2024-01-15 15:27:53 +00:00
zip_name: freedata-server_windows
2023-12-31 12:22:54 +00:00
generator: Visual Studio 16 2019
2024-04-18 09:04:25 +00:00
modem_binary_name: freedata_server.exe
2023-12-31 12:22:54 +00:00
steps:
- name: Checkout code for ${{ matrix.platform.name }}
uses: actions/checkout@v4
with:
repository: DJ2LS/FreeDATA
- name: Set up Python 3.11
uses: actions/setup-python@v5
2023-12-31 12:22:54 +00:00
with:
python-version: "3.11"
- name: Install Linux dependencies
# if: matrix.os == 'ubuntu-20.04'
if: ${{startsWith(matrix.os, 'ubuntu')}}
run: |
sudo apt install -y portaudio19-dev libhamlib-dev libhamlib-utils build-essential cmake python3-libhamlib2 patchelf
- name: Install MacOS pyAudio
if: ${{startsWith(matrix.os, 'macos')}}
run: |
brew install portaudio
python -m pip install --upgrade pip
pip3 install pyaudio
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Add MacOS certs
if: ${{startsWith(matrix.os, 'macos')}}
run: chmod +x add-osx-cert.sh && ./add-osx-cert.sh
env:
CERTIFICATE_OSX_APPLICATION: ${{ secrets.CERTIFICATE_OSX_APPLICATION }}
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}
- name: Build binaries
2024-04-18 09:04:25 +00:00
working-directory: freedata_server
2023-12-31 12:22:54 +00:00
run: |
2024-01-13 18:22:54 +00:00
python3 -m nuitka --remove-output --assume-yes-for-downloads --follow-imports --include-data-dir=lib=lib --include-data-files=lib/codec2/*=lib/codec2/ --include-data-files=config.ini.example=config.ini --standalone server.py --output-filename=freedata-server
#- name: Download Portaudio binaries Linux macOS
# if: ${{!startsWith(matrix.os, 'windows')}}
2024-04-18 09:04:25 +00:00
# working-directory: freedata_server
2024-01-13 18:22:54 +00:00
# run: |
2024-04-18 09:04:25 +00:00
# if ! test -d "server.dist/freedata_server/_sounddevice_data"; then
# git clone https://github.com/spatialaudio/portaudio-binaries dist/freedata_server/_sounddevice_data/portaudio-binaries
2024-01-13 18:22:54 +00:00
# fi
#- name: Download Portaudio binaries Windows
# if: ${{startsWith(matrix.os, 'windows')}}
2024-04-18 09:04:25 +00:00
# working-directory: freedata_server
2024-01-13 18:22:54 +00:00
# run: |
2024-04-18 09:04:25 +00:00
# if(Test-Path -Path "server.dist/freedata_server/_sounddevice_data"){
2024-01-13 18:22:54 +00:00
# echo "sounddevice folder already exists"
# } else {
2024-04-18 09:04:25 +00:00
# git clone https://github.com/spatialaudio/portaudio-binaries dist/freedata_server/_sounddevice_data/portaudio-binaries
2024-01-13 18:22:54 +00:00
# }
2023-12-31 12:22:54 +00:00
- name: LIST ALL FILES
run: ls -R
- name: cleanup on macos before code signing
if: ${{startsWith(matrix.os, 'macos')}}
run: |
ls -l
# find . -type d -name .git -exec rm -r {} \;
find . -type d -o -name ".git" -delete
- name: Compress Modem
uses: thedoctor0/zip-release@master
with:
type: 'zip'
2024-01-15 15:34:41 +00:00
filename: '${{ matrix.zip_name }}.zip'
2024-04-18 09:04:25 +00:00
directory: ./freedata_server/server.dist
2023-12-31 12:22:54 +00:00
path: .
# exclusions: '*.git* /*node_modules/* .editorconfig'
2024-01-15 15:10:28 +00:00
- name: LIST ALL FILES
run: ls -R
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
2024-01-15 15:34:41 +00:00
name: '${{ matrix.zip_name }}'
2024-04-18 09:04:25 +00:00
path: ./freedata_server/server.dist/${{ matrix.zip_name }}.zip
2024-01-14 20:05:53 +00:00
2023-12-31 12:22:54 +00:00
- name: Release Modem
uses: softprops/action-gh-release@v2
2023-12-31 12:22:54 +00:00
if: startsWith(github.ref, 'refs/tags/v')
with:
draft: true
2024-04-18 09:04:25 +00:00
files: ./freedata_server/server.dist/${{ matrix.zip_name }}.zip
2023-12-31 12:22:54 +00:00
- name: LIST ALL FILES
run: ls -R