FreeDATA/.github/workflows/build-project.yml

252 lines
7.6 KiB
YAML
Raw Normal View History

2021-08-28 07:44:35 +00:00
name: Build/PROJECT
2021-08-28 08:51:29 +00:00
on:
push:
2021-08-28 12:34:23 +00:00
#tags:
#- '*'
2021-08-28 10:39:07 +00:00
2021-08-28 07:44:35 +00:00
jobs:
2021-08-28 10:12:58 +00:00
2021-09-11 15:08:41 +00:00
build_windows_release:
name: Build Windows release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
include:
- os: windows-latest
zip_name: windows_tnc
generator: Visual Studio 16 2019
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
2021-10-26 14:54:34 +00:00
- name: Install Python dependencies
2021-09-11 15:14:27 +00:00
if: matrix.os == 'windows-latest'
run: |
python -m pip install --upgrade pip
pip install psutil
pip install crcengine
pip install pyinstaller
pip install ujson
pip install pyserial
pip install numpy
2021-11-18 18:46:07 +00:00
pip install structlog
2021-10-26 14:54:34 +00:00
# curl.exe --output PyAudio-0.2.11-cp39-cp39-win_amd64.whl --url https://download.lfd.uci.edu/pythonlibs/y2rycu7g/PyAudio-0.2.11-cp39-cp39-win_amd64.whl
# pip install PyAudio-0.2.11-cp39-cp39-win_amd64.whl
- name: Install Pyaudio
if: matrix.os == 'windows-latest'
2021-11-18 18:46:07 +00:00
working-directory: tnc/lib/pyaudio/windows
2021-10-26 14:54:34 +00:00
run: |
2021-09-11 15:14:27 +00:00
pip install PyAudio-0.2.11-cp39-cp39-win_amd64.whl
2021-10-26 14:54:34 +00:00
2021-09-11 15:08:41 +00:00
2021-09-11 15:14:27 +00:00
- name: Build DAEMON and TNC Windows
if: matrix.os == 'windows-latest'
working-directory: tnc
run: |
pyinstaller -F daemon.py -n daemon
#pyinstaller -F --add-binary libcodec2.dll;. --add-binary hamlib/windows/hamlib-4.dll;. --add-binary hamlib/linux/Hamlib.py:. -n tnc main.py
2021-09-11 16:59:48 +00:00
2021-09-11 15:16:57 +00:00
- name: LIST ALL FILES
shell: bash
run: |
2021-09-11 16:59:48 +00:00
ls -R
2021-09-11 15:16:57 +00:00
2021-09-11 16:59:48 +00:00
- name: Build codec2
shell: bash
run: |
choco install ninja cmake
ninja --version
cmake --version
2021-09-11 15:14:27 +00:00
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 14
2021-09-11 15:08:41 +00:00
build_linux_release:
name: Build Linux release
2021-08-28 07:44:35 +00:00
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
2021-08-28 07:44:35 +00:00
include:
- os: ubuntu-20.04
2021-08-28 10:54:40 +00:00
zip_name: ubuntu_tnc
2021-08-28 07:44:35 +00:00
generator: Unix Makefiles
steps:
- name: Checkout code
uses: actions/checkout@v2
2021-08-28 08:57:00 +00:00
2021-08-29 13:31:42 +00:00
- name: Set up Python 3.9
2021-08-28 08:57:00 +00:00
uses: actions/setup-python@v2
with:
2021-09-11 15:08:41 +00:00
python-version: 3.9
2021-09-11 15:14:27 +00:00
2021-09-11 15:08:41 +00:00
2021-08-28 08:57:00 +00:00
2021-08-28 07:44:35 +00:00
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-20.04'
2021-08-28 07:44:35 +00:00
run: |
2021-08-29 13:54:23 +00:00
sudo apt install portaudio19-dev libhamlib-dev libhamlib-utils build-essential cmake python3-libhamlib2
2021-08-28 07:44:35 +00:00
python -m pip install --upgrade pip
pip3 install pyaudio
pip3 install psutil
pip3 install crcengine
pip3 install pyinstaller
2021-08-28 13:01:39 +00:00
pip3 install ujson
2021-09-04 20:13:42 +00:00
pip3 install pyserial
2021-09-05 12:53:07 +00:00
pip3 install numpy
2021-11-18 18:46:07 +00:00
pip3 install structlog
2021-08-29 13:31:42 +00:00
2021-09-11 15:14:27 +00:00
2021-09-02 18:15:33 +00:00
#- name: Build Hamlib Python Binding
# if: matrix.os == 'ubuntu-latest'
# working-directory: tnc
# run: |
# sudo apt install wig libtool
# cd ~
# git clone https://github.com/Hamlib/Hamlib.git
# cd Hamlib
# ./bootstrap
# ./configure --with-python-binding PYTHON_VERSION='3.9' --prefix=$HOME/local
# make
# make install
2021-08-29 13:31:42 +00:00
2021-09-05 13:34:28 +00:00
2021-08-28 12:34:23 +00:00
- name: Build codec2 Linux
if: matrix.os == 'ubuntu-20.04'
2021-09-05 13:39:17 +00:00
#working-directory: tnc
2021-08-28 12:34:23 +00:00
run: |
2021-09-05 13:44:11 +00:00
cd ~
2021-08-28 12:34:23 +00:00
git clone https://github.com/drowe67/codec2.git
cd codec2 && mkdir build_linux && cd build_linux
cmake ../
make
2021-09-05 13:39:17 +00:00
2021-09-05 13:34:28 +00:00
- name: Build Linux
if: matrix.os == 'ubuntu-20.04'
2021-09-05 13:34:28 +00:00
working-directory: tnc
run: |
2021-11-08 15:09:39 +00:00
#pyinstaller -F daemon.py -n daemon
2021-11-18 18:46:07 +00:00
pyinstaller -F daemon.py --add-binary lib/hamlib/linux/_Hamlib.cpython-39-x86_64-linux-gnu.so:./lib/hamlib/linux/ --add-binary lib/hamlib/linux/Hamlib.py:./lib/hamlib/linux/ -n daemon
pyinstaller -F --add-binary ~/codec2/build_linux/src/libcodec2.so.1.0:. --add-binary lib/hamlib/linux/_Hamlib.cpython-39-x86_64-linux-gnu.so:./lib/hamlib/linux/ --add-binary lib/hamlib/linux/Hamlib.py:./lib/hamlib/linux/ -n tnc main.py
2021-09-05 13:34:28 +00:00
2021-08-28 12:37:53 +00:00
- name: LIST ALL FILES
shell: bash
run: |
ls -R
2021-09-05 13:22:01 +00:00
2021-08-28 07:44:35 +00:00
- name: Compress Linux
shell: bash
run: |
cd ./tnc/dist
2021-08-28 10:44:12 +00:00
mkdir compressed
zip -r ./compressed/${{ matrix.zip_name }}.zip *
2021-08-28 10:54:40 +00:00
- name: Upload Ubuntu TNC artifacts
2021-08-28 10:44:12 +00:00
uses: actions/upload-artifact@v2
with:
2021-08-28 10:47:34 +00:00
name: tnc-artifact
path: ./tnc/dist/compressed/*
2021-08-28 10:44:12 +00:00
2021-08-28 10:58:46 +00:00
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 14
2021-08-28 12:58:39 +00:00
- name: Copy TNC to GUI Linux
if: matrix.os == 'ubuntu-20.04'
2021-08-28 12:58:39 +00:00
run: |
cp -R ./tnc/dist ./gui/tnc
ls -R
2021-08-28 10:58:46 +00:00
- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1
with:
package_root: "./gui/"
2021-08-28 11:06:43 +00:00
github_token: ${{ secrets.github_token }}
2021-08-28 10:44:12 +00:00
2021-08-28 10:58:46 +00:00
- name: LIST ALL FILES
shell: bash
run: |
2021-08-28 11:24:34 +00:00
ls -R
2021-08-28 10:58:46 +00:00
2021-08-28 11:24:34 +00:00
- name: chmod +x
shell: bash
run: |
2021-08-28 13:35:54 +00:00
chmod +x ./gui/dist/*.AppImage
- name: Create app bundle
shell: bash
run: |
mkdir gui-bundle
cp ./gui/dist/*.AppImage gui-bundle
2021-08-28 14:36:31 +00:00
cp ./tnc/dist/daemon gui-bundle
cp ./tnc/dist/tnc gui-bundle
2021-09-05 13:58:14 +00:00
chmod +x ./gui-bundle/tnc
chmod +x ./gui-bundle/daemon
2021-08-28 13:47:55 +00:00
cd ./gui-bundle
2021-09-16 15:22:11 +00:00
zip -r FreeDATA_linux.zip .
2021-08-28 13:57:46 +00:00
ls -R
2021-08-28 10:58:46 +00:00
2021-08-28 12:58:39 +00:00
- name: Upload Ubuntu GUI Bundle artifacts
2021-08-28 10:58:46 +00:00
uses: actions/upload-artifact@v2
with:
2021-08-28 13:47:55 +00:00
name: gui-bundle-ubuntu-artifact
2021-09-16 15:22:11 +00:00
path: ./gui-bundle/FreeDATA_linux.zip
2021-08-28 10:54:40 +00:00
release:
name: Upload Release
2021-09-11 15:09:47 +00:00
needs: [build_linux_release, build_windows_release]
runs-on: ubuntu-20.04
2021-08-28 10:54:40 +00:00
steps:
2021-08-28 10:39:07 +00:00
- name: Download artifact
uses: actions/download-artifact@v2
- name: LIST ALL FILES
shell: bash
run: |
ls -R
2021-08-28 10:54:40 +00:00
2021-08-28 10:39:07 +00:00
- name: Release
2021-08-28 16:20:22 +00:00
uses: WebFreak001/deploy-nightly@v1.1.0
#uses: softprops/action-gh-release@v1
#if: startsWith(github.ref, 'refs/tags/')
2021-08-28 08:03:40 +00:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2021-08-28 07:44:35 +00:00
with:
2021-09-16 15:22:11 +00:00
upload_url: https://uploads.github.com/repos/DJ2LS/FreeDATA/releases/48616289/assets{?name,label} # find out this value by opening https://api.github.com/repos/<owner>/<repo>/releases in your browser and copy the full "upload_url" value including the {?name,label} part
2021-08-28 16:20:22 +00:00
release_id: 48616289 # same as above (id can just be taken out the upload_url, it's used to find old releases)
2021-09-16 15:22:11 +00:00
asset_path: ./gui-bundle-ubuntu-artifact/FreeDATA_linux.zip # path to archive to upload
asset_name: FreeDATA_linux-nightly-$$.zip # name to upload the release as, use $$ to insert date (YYYYMMDD) and 6 letter commit hash
2021-08-28 16:20:22 +00:00
asset_content_type: application/zip # required by GitHub API
2021-09-04 19:39:12 +00:00
max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted
2021-08-28 16:20:22 +00:00
#files: |
# ./gui-bundle-ubuntu-artifact/codec2-FreeDATA_ubuntu.zip
# ./tnc-artifact/ubuntu_tnc.zip
# LICENSE