2022-02-25 09:29:38 +00:00
|
|
|
name: macOS
|
2022-02-16 15:47:01 +00:00
|
|
|
on:
|
|
|
|
push:
|
2022-02-25 09:29:38 +00:00
|
|
|
tags:
|
|
|
|
- 'v*'
|
2022-02-16 15:47:01 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_linux_release:
|
2022-02-16 15:53:48 +00:00
|
|
|
name: Build macOS release
|
2022-02-16 15:47:01 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [macos-10.15]
|
|
|
|
include:
|
|
|
|
- os: macos-10.15
|
2022-02-16 16:31:18 +00:00
|
|
|
zip_name: mac_tnc
|
2022-02-16 15:47:01 +00:00
|
|
|
generator: Unix Makefiles
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
ref: ls-leave-prototype
|
|
|
|
|
|
|
|
- name: Set up Python 3.9
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: 3.9
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-16 15:53:48 +00:00
|
|
|
- name: Install macOS dependencies
|
2022-02-16 15:47:01 +00:00
|
|
|
if: matrix.os == 'macos-10.15'
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip3 install psutil
|
|
|
|
pip3 install crcengine
|
|
|
|
pip3 install pyinstaller
|
|
|
|
pip3 install ujson
|
|
|
|
pip3 install pyserial
|
|
|
|
pip3 install numpy
|
|
|
|
pip3 install structlog
|
|
|
|
|
|
|
|
- name: Install Portaudio
|
|
|
|
if: matrix.os == 'macos-10.15'
|
|
|
|
run: |
|
|
|
|
brew install portaudio
|
|
|
|
pip3 install pyaudio
|
|
|
|
|
|
|
|
|
2022-02-16 15:58:19 +00:00
|
|
|
- name: Build codec2 macOS
|
2022-02-16 15:47:01 +00:00
|
|
|
if: matrix.os == 'macos-10.15'
|
|
|
|
working-directory: tnc
|
|
|
|
run: |
|
|
|
|
git clone https://github.com/drowe67/codec2.git
|
|
|
|
cd codec2 && mkdir build_mac && cd build_mac
|
|
|
|
cmake ../
|
|
|
|
make
|
|
|
|
|
|
|
|
|
2022-02-16 16:31:18 +00:00
|
|
|
- name: Build macOS pyinstaller
|
2022-02-16 15:47:01 +00:00
|
|
|
if: matrix.os == 'macos-10.15'
|
|
|
|
working-directory: tnc
|
|
|
|
run: |
|
|
|
|
pyinstaller freedata.spec
|
|
|
|
|
|
|
|
- name: LIST ALL FILES
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
ls -R
|
|
|
|
|
|
|
|
|
|
|
|
- name: Compress
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
cd ./tnc/dist
|
|
|
|
mkdir compressed
|
|
|
|
zip -r ./compressed/${{ matrix.zip_name }}.zip *
|
|
|
|
|
|
|
|
- name: Upload macOS TNC artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: tnc-artifact
|
|
|
|
path: ./tnc/dist/compressed/*
|
|
|
|
|
2022-02-23 07:51:06 +00:00
|
|
|
|
2022-02-23 06:36:47 +00:00
|
|
|
|
|
|
|
|
2022-02-16 15:47:01 +00:00
|
|
|
- name: Copy TNC to GUI
|
|
|
|
if: matrix.os == 'macos-10.15'
|
|
|
|
run: |
|
|
|
|
cp -R ./tnc/dist/tnc ./gui/tnc
|
|
|
|
ls -R
|
|
|
|
|
|
|
|
- name: Install Node.js, NPM and Yarn
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
2022-02-22 10:06:22 +00:00
|
|
|
node-version: 16
|
2022-02-16 15:47:01 +00:00
|
|
|
|
2022-02-25 09:00:18 +00:00
|
|
|
|
2022-02-16 15:47:01 +00:00
|
|
|
- name: Build/release Electron app
|
|
|
|
uses: samuelmeuli/action-electron-builder@v1
|
|
|
|
with:
|
|
|
|
package_root: "./gui/"
|
|
|
|
github_token: ${{ secrets.github_token }}
|
2022-02-22 10:06:22 +00:00
|
|
|
# If the commit is tagged with a version (e.g. "v1.0.0"),
|
|
|
|
# release the app after building
|
|
|
|
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
2022-02-25 09:29:38 +00:00
|
|
|
args: "-p always"
|
|
|
|
|
2022-02-25 09:00:18 +00:00
|
|
|
- name: Release TNC
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
|
|
with:
|
|
|
|
files: ./tnc/dist/compressed/${{ matrix.zip_name }}.zip
|
|
|
|
|