2021-11-19 11:22:27 +03:00
|
|
|
name: Linux
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
2022-11-12 16:54:24 +03:00
|
|
|
helper:
|
|
|
|
name: Build helper
|
|
|
|
runs-on: ubuntu-latest
|
2022-11-24 18:33:37 +03:00
|
|
|
env:
|
|
|
|
PYVER: 3.11
|
2022-11-12 16:54:24 +03:00
|
|
|
container:
|
|
|
|
image: ubuntu:18.04
|
|
|
|
env:
|
|
|
|
DEBIAN_FRONTEND: noninteractive
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2021-11-19 11:22:27 +03:00
|
|
|
|
2022-11-24 18:33:37 +03:00
|
|
|
- name: Cache helper
|
|
|
|
id: cache-helper
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: helper.tar.gz
|
|
|
|
key: ${{ runner.os }}-py${{ env.PYVER }}-${{ hashFiles('helper/**') }}
|
|
|
|
|
2022-11-12 16:54:24 +03:00
|
|
|
- name: Install dependencies
|
2022-11-24 18:33:37 +03:00
|
|
|
if: steps.cache-helper.outputs.cache-hit != 'true'
|
2022-11-12 16:54:24 +03:00
|
|
|
run: |
|
|
|
|
apt-get update
|
|
|
|
apt-get install -qq swig libpcsclite-dev software-properties-common build-essential cmake git
|
|
|
|
add-apt-repository -y ppa:deadsnakes/ppa
|
2022-11-24 18:33:37 +03:00
|
|
|
apt-get install -qq python$PYVER-dev python$PYVER-venv
|
|
|
|
python$PYVER -m ensurepip --user
|
|
|
|
python$PYVER -m pip install -U pip
|
|
|
|
python$PYVER -m pip install poetry
|
2022-11-12 16:54:24 +03:00
|
|
|
|
|
|
|
- name: Build the Helper
|
2022-11-24 18:33:37 +03:00
|
|
|
if: steps.cache-helper.outputs.cache-hit != 'true'
|
2022-11-12 16:54:24 +03:00
|
|
|
run: ./build-helper.sh
|
|
|
|
|
|
|
|
- name: Create archive
|
2022-11-24 18:33:37 +03:00
|
|
|
if: steps.cache-helper.outputs.cache-hit != 'true'
|
2022-11-12 16:54:24 +03:00
|
|
|
run: tar -czf helper.tar.gz build/linux/helper assets/licenses/helper.json
|
|
|
|
|
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: helper
|
|
|
|
path: helper.tar.gz
|
|
|
|
|
|
|
|
build:
|
|
|
|
name: Build app
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: helper
|
2021-11-19 11:22:27 +03:00
|
|
|
|
|
|
|
steps:
|
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-11-12 16:54:24 +03:00
|
|
|
- name: Download helper
|
|
|
|
uses: actions/download-artifact@v3
|
2021-11-19 11:22:27 +03:00
|
|
|
with:
|
2022-11-12 16:54:24 +03:00
|
|
|
name: helper
|
|
|
|
|
|
|
|
- name: Unpack helper
|
|
|
|
run: |
|
|
|
|
tar -xf helper.tar.gz
|
2021-11-19 11:22:27 +03:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2022-11-12 16:54:24 +03:00
|
|
|
sudo apt-get install -qq clang cmake ninja-build pkg-config libgtk-3-dev
|
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-11-24 19:01:47 +03:00
|
|
|
flutter-version: '3.3.9'
|
2021-11-19 11:22:27 +03:00
|
|
|
- run: flutter config --enable-linux-desktop
|
|
|
|
- run: flutter --version
|
|
|
|
|
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
|
|
|
|
|
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
|