yubioath-flutter/.github/workflows/linux.yml

109 lines
2.7 KiB
YAML
Raw Normal View History

2021-11-19 11:22:27 +03:00
name: Linux
on: [push, pull_request]
jobs:
helper:
name: Build helper
runs-on: ubuntu-latest
2022-11-24 18:33:37 +03:00
env:
PYVER: 3.11
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/**') }}
- name: Install dependencies
2022-11-24 18:33:37 +03:00
if: steps.cache-helper.outputs.cache-hit != 'true'
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
- name: Build the Helper
2022-11-24 18:33:37 +03:00
if: steps.cache-helper.outputs.cache-hit != 'true'
run: ./build-helper.sh
- name: Create archive
2022-11-24 18:33:37 +03:00
if: steps.cache-helper.outputs.cache-hit != 'true'
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:
- 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
- name: Download helper
uses: actions/download-artifact@v3
2021-11-19 11:22:27 +03:00
with:
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
sudo apt-get install -qq clang cmake ninja-build pkg-config libgtk-3-dev
2021-11-19 11:22:27 +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
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
- 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)
export BASENAME="yubioath-desktop-${REF}-linux"
2021-11-19 11:22:27 +03:00
mkdir deploy
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
uses: actions/upload-artifact@v3
2021-11-19 11:22:27 +03:00
with:
name: yubioath-desktop-linux
path: deploy