2021-11-19 11:22:27 +03:00
|
|
|
name: Linux
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
2022-12-08 23:19:22 +03:00
|
|
|
build:
|
|
|
|
|
2022-11-12 16:54:24 +03:00
|
|
|
runs-on: ubuntu-latest
|
2022-11-24 18:33:37 +03:00
|
|
|
env:
|
2023-04-17 10:58:37 +03:00
|
|
|
PYVER: '3.11.3'
|
2023-05-22 10:57:00 +03:00
|
|
|
FLUTTER: '3.10.1'
|
2022-11-12 16:54:24 +03:00
|
|
|
container:
|
|
|
|
image: ubuntu:18.04
|
|
|
|
env:
|
|
|
|
DEBIAN_FRONTEND: noninteractive
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2023-04-17 10:58:37 +03:00
|
|
|
export PYVER_MINOR=${PYVER%.*}
|
|
|
|
echo "PYVER_MINOR: $PYVER_MINOR"
|
2022-11-12 16:54:24 +03:00
|
|
|
apt-get update
|
2023-02-24 16:24:13 +03:00
|
|
|
apt-get install -qq software-properties-common libnotify-dev libayatana-appindicator3-dev patchelf
|
2022-12-08 23:19:22 +03:00
|
|
|
add-apt-repository -y ppa:git-core/ppa
|
2022-11-12 16:54:24 +03:00
|
|
|
add-apt-repository -y ppa:deadsnakes/ppa
|
2023-04-17 10:58:37 +03:00
|
|
|
apt-get install -qq git python$PYVER_MINOR-dev python$PYVER_MINOR-venv
|
2022-12-08 23:19:22 +03:00
|
|
|
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
2023-04-17 10:58:37 +03:00
|
|
|
ln -s `which python$PYVER_MINOR` /usr/local/bin/python
|
|
|
|
PYVER_TEMP=`/usr/local/bin/python --version`
|
|
|
|
export PYVERINST=${PYVER_TEMP#* }
|
|
|
|
echo "PYVERINST=$PYVERINST" >> $GITHUB_ENV
|
|
|
|
echo "Installed python version: $PYVERINST"
|
|
|
|
|
|
|
|
- name: Verify Python version
|
|
|
|
if: ${{ env.PYVERINST != env.PYVER }}
|
|
|
|
run: |
|
|
|
|
echo "Python version not compatible"
|
|
|
|
echo "Installed python version: $PYVERINST"
|
|
|
|
echo "Expected: $PYVER"
|
|
|
|
exit 1
|
2022-11-12 16:54:24 +03:00
|
|
|
|
2022-10-24 09:49:06 +03:00
|
|
|
- uses: actions/checkout@v3
|
2021-11-19 11:22:27 +03:00
|
|
|
|
2022-11-24 18:33:37 +03:00
|
|
|
- name: Check app versions
|
|
|
|
run: |
|
|
|
|
python set-version.py
|
|
|
|
git diff --exit-code
|
|
|
|
|
2022-12-08 23:19:22 +03:00
|
|
|
- name: Cache helper
|
|
|
|
id: cache-helper
|
|
|
|
uses: actions/cache@v3
|
2021-11-19 11:22:27 +03:00
|
|
|
with:
|
2022-12-08 23:19:22 +03:00
|
|
|
path: |
|
|
|
|
build/linux/helper
|
|
|
|
assets/licenses/helper.json
|
|
|
|
key: ${{ runner.os }}-py${{ env.PYVER }}-${{ hashFiles('helper/**') }}
|
2022-11-12 16:54:24 +03:00
|
|
|
|
2022-12-08 23:19:22 +03:00
|
|
|
- name: Install helper dependencies
|
|
|
|
if: steps.cache-helper.outputs.cache-hit != 'true'
|
2022-11-12 16:54:24 +03:00
|
|
|
run: |
|
2022-12-08 23:19:22 +03:00
|
|
|
apt-get install -qq swig libpcsclite-dev build-essential cmake
|
|
|
|
python -m ensurepip --user
|
2023-02-01 12:30:12 +03:00
|
|
|
python -m pip install -U pip pipx
|
|
|
|
pipx ensurepath
|
|
|
|
pipx install poetry
|
2021-11-19 11:22:27 +03:00
|
|
|
|
2022-12-08 23:19:22 +03:00
|
|
|
- name: Build the Helper
|
|
|
|
if: steps.cache-helper.outputs.cache-hit != 'true'
|
2023-02-01 12:30:12 +03:00
|
|
|
run: |
|
|
|
|
. ~/.bashrc # Needed to ensure poetry on PATH
|
|
|
|
./build-helper.sh
|
2022-12-08 23:19:22 +03:00
|
|
|
|
|
|
|
- name: Install Flutter dependencies
|
2021-11-19 11:22:27 +03:00
|
|
|
run: |
|
2022-12-08 23:19:22 +03:00
|
|
|
apt-get install -qq clang cmake ninja-build pkg-config libgtk-3-dev jq
|
2021-11-19 11:22:27 +03:00
|
|
|
|
2022-04-27 15:42:05 +03:00
|
|
|
- uses: subosito/flutter-action@v2
|
2021-11-19 11:22:27 +03:00
|
|
|
with:
|
2022-05-12 09:36:47 +03:00
|
|
|
channel: 'stable'
|
2022-12-08 23:19:22 +03:00
|
|
|
flutter-version: ${{ env.FLUTTER }}
|
|
|
|
|
|
|
|
- name: Configure Flutter
|
|
|
|
run: |
|
|
|
|
git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-$FLUTTER-x64
|
|
|
|
flutter config --enable-linux-desktop
|
|
|
|
flutter --version
|
2021-11-19 11:22:27 +03:00
|
|
|
|
2021-11-19 12:23:01 +03:00
|
|
|
- name: Run tests
|
2021-11-19 13:20:57 +03:00
|
|
|
run: |
|
|
|
|
flutter test
|
|
|
|
flutter analyze
|
2021-11-19 12:23:01 +03:00
|
|
|
|
2021-11-19 11:22:27 +03:00
|
|
|
- name: Build the app
|
2021-11-19 12:23:01 +03:00
|
|
|
run: flutter build linux
|
2021-11-19 11:22:27 +03:00
|
|
|
|
2022-04-04 16:43:04 +03:00
|
|
|
- name: Check generated files
|
|
|
|
run: git diff --exit-code
|
|
|
|
|
2023-02-24 16:24:13 +03:00
|
|
|
- name: Embedd appindicator
|
|
|
|
run: |
|
|
|
|
patchelf --set-rpath '$ORIGIN' build/linux/x64/release/bundle/lib/libtray_manager_plugin.so
|
|
|
|
cp -L /usr/lib/x86_64-linux-gnu/libayatana-appindicator3.so.1 build/linux/x64/release/bundle/lib/
|
|
|
|
patchelf --set-rpath '$ORIGIN' build/linux/x64/release/bundle/lib/libayatana-appindicator3.so.1
|
|
|
|
cp -L /usr/lib/x86_64-linux-gnu/libayatana-indicator3.so.7 build/linux/x64/release/bundle/lib/
|
|
|
|
patchelf --set-rpath '$ORIGIN' build/linux/x64/release/bundle/lib/libayatana-indicator3.so.7
|
|
|
|
cp -L /usr/lib/x86_64-linux-gnu/libdbusmenu-glib.so.4 build/linux/x64/release/bundle/lib/
|
|
|
|
patchelf --set-rpath '$ORIGIN' build/linux/x64/release/bundle/lib/libdbusmenu-glib.so.4
|
|
|
|
cp -L /usr/lib/x86_64-linux-gnu/libdbusmenu-gtk3.so.4 build/linux/x64/release/bundle/lib/
|
|
|
|
patchelf --set-rpath '$ORIGIN' build/linux/x64/release/bundle/lib/libdbusmenu-gtk3.so.4
|
|
|
|
|
2021-11-19 11:22:27 +03:00
|
|
|
- name: Rename and archive app
|
|
|
|
run: |
|
|
|
|
export REF=$(echo ${GITHUB_REF} | cut -d '/' -f 3)
|
2022-11-11 17:18:47 +03:00
|
|
|
export BASENAME="yubioath-desktop-${REF}-linux"
|
2021-11-19 11:22:27 +03:00
|
|
|
mkdir deploy
|
2022-11-11 17:18:47 +03:00
|
|
|
mv build/linux/x64/release/bundle "build/${BASENAME}"
|
|
|
|
tar -czf deploy/${BASENAME}.tar.gz -C build "${BASENAME}"
|
2021-11-19 11:22:27 +03:00
|
|
|
|
|
|
|
- name: Upload artifact
|
2022-10-24 09:49:06 +03:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-11-19 11:22:27 +03:00
|
|
|
with:
|
|
|
|
name: yubioath-desktop-linux
|
|
|
|
path: deploy
|