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

167 lines
4.2 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-08-28 07:44:35 +00:00
build_release:
name: Build release
runs-on: ${{ matrix.os }}
strategy:
matrix:
2021-08-28 07:50:06 +00:00
os: [ubuntu-latest]
2021-08-28 07:44:35 +00:00
include:
- os: ubuntu-latest
2021-08-28 10:54:40 +00:00
zip_name: ubuntu_tnc
2021-08-28 07:44:35 +00:00
generator: Unix Makefiles
2021-08-28 07:50:06 +00:00
#- os: macos-latest
# zip_name: plugin-mac
# generator: Xcode
#- os: windows-latest
# zip_name: plugin-win
# generator: Visual Studio 16 2019
2021-08-28 07:44:35 +00:00
steps:
- name: Checkout code
uses: actions/checkout@v2
2021-08-28 08:57:00 +00:00
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
2021-08-28 10:12:58 +00:00
python-version: 3.8
2021-08-28 08:57:00 +00:00
2021-08-28 07:44:35 +00:00
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: |
2021-08-28 12:34:23 +00:00
sudo apt install portaudio19-dev build-essential cmake
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 10:12:58 +00:00
2021-08-28 10:47:34 +00:00
- name: Build Linux
2021-08-28 07:44:35 +00:00
if: matrix.os == 'ubuntu-latest'
working-directory: tnc
run: |
pyinstaller -F daemon.py -n daemon
pyinstaller -F main.py -n tnc
2021-08-28 12:34:23 +00:00
- name: Build codec2 Linux
if: matrix.os == 'ubuntu-latest'
# working-directory: tnc
run: |
cd ~
git clone https://github.com/drowe67/codec2.git
cd codec2 && mkdir build_linux && cd build_linux
cmake ../
make
- name: Build LPCNet Linux
if: matrix.os == 'ubuntu-latest'
# working-directory: tnc
run: |
cd ~
git clone https://github.com/drowe67/LPCNet
cd LPCNet && mkdir build_linux && cd build_linux
cmake -DCODEC2_BUILD_DIR=~/codec2/build_linux ../
make
2021-08-28 10:31:18 +00:00
2021-08-28 12:34:23 +00:00
- name: ReBuild codec2 with LPCNet Linux
if: matrix.os == 'ubuntu-latest'
# working-directory: tnc
run: |
cd ~/codec2/build_linux && rm -Rf *
cmake -DLPCNET_BUILD_DIR=~/LPCNet/build_linux ..
make
2021-08-28 12:37:53 +00:00
- name: LIST ALL FILES
shell: bash
run: |
ls -R
2021-08-28 12:34:23 +00:00
- name: Copy codec2 to TNC Linux
if: matrix.os == 'ubuntu-latest'
# working-directory: tnc
run: |
2021-08-28 12:35:34 +00:00
cp -R ~/codec2 ./tnc/dist
2021-08-28 12:34:23 +00:00
ls -R
2021-08-28 10:31:18 +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
- 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: |
chmod +x ./gui/dist/*.AppImage
2021-08-28 10:58:46 +00:00
- name: Upload Ubuntu GUI artifacts
uses: actions/upload-artifact@v2
with:
name: gui-artifact
2021-08-28 11:24:34 +00:00
path: ./gui/dist/*.AppImage
2021-08-28 10:54:40 +00:00
release:
name: Upload Release
2021-08-28 11:03:53 +00:00
needs: build_release
2021-08-28 10:56:41 +00:00
runs-on: ubuntu-latest
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 10:12:58 +00:00
uses: softprops/action-gh-release@v1
2021-08-28 08:03:40 +00:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2021-08-28 07:44:35 +00:00
with:
2021-08-28 10:12:58 +00:00
#upload_url: ${{ needs.create_release.outputs.upload_url }}
#asset_path: ./tnc/compressed/${{ matrix.zip_name }}.zip
#asset_name: ${{ matrix.zip_name }}.zip
#asset_content_type: application/zip
files: |
./tnc/compressed/${{ matrix.zip_name }}.zip
LICENSE