This commit is contained in:
Dain Nilsson 2022-11-25 08:59:23 +01:00
commit 868a3369fa
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
3 changed files with 63 additions and 24 deletions

View File

@ -6,6 +6,8 @@ jobs:
helper: helper:
name: Build helper name: Build helper
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
PYVER: 3.11
container: container:
image: ubuntu:18.04 image: ubuntu:18.04
env: env:
@ -14,20 +16,30 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- 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 - name: Install dependencies
if: steps.cache-helper.outputs.cache-hit != 'true'
run: | run: |
apt-get update apt-get update
apt-get install -qq swig libpcsclite-dev software-properties-common build-essential cmake git apt-get install -qq swig libpcsclite-dev software-properties-common build-essential cmake git
add-apt-repository -y ppa:deadsnakes/ppa add-apt-repository -y ppa:deadsnakes/ppa
apt-get install -qq python3.11-dev python3.11-venv apt-get install -qq python$PYVER-dev python$PYVER-venv
python3.11 -m ensurepip --user python$PYVER -m ensurepip --user
python3.11 -m pip install -U pip python$PYVER -m pip install -U pip
python3.11 -m pip install poetry python$PYVER -m pip install poetry
- name: Build the Helper - name: Build the Helper
if: steps.cache-helper.outputs.cache-hit != 'true'
run: ./build-helper.sh run: ./build-helper.sh
- name: Create archive - name: Create archive
if: steps.cache-helper.outputs.cache-hit != 'true'
run: tar -czf helper.tar.gz build/linux/helper assets/licenses/helper.json run: tar -czf helper.tar.gz build/linux/helper assets/licenses/helper.json
- name: Upload artifact - name: Upload artifact
@ -44,6 +56,11 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Check app versions
run: |
python set-version.py
git diff --exit-code
- name: Download helper - name: Download helper
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
@ -53,11 +70,6 @@ jobs:
run: | run: |
tar -xf helper.tar.gz tar -xf helper.tar.gz
- name: Check app versions
run: |
python set-version.py
git diff --exit-code
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt-get update sudo apt-get update

View File

@ -6,27 +6,44 @@ jobs:
build: build:
runs-on: macos-latest runs-on: macos-latest
env:
PYVER: 3.11
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Check app versions - name: Check app versions
run: | run: |
python set-version.py python3 set-version.py
git diff --exit-code git diff --exit-code
- name: Cache helper
id: cache-helper
uses: actions/cache@v3
with:
path: |
build/macos/helper
assets/licenses/helper.json
key: ${{ runner.os }}-py${{ env.PYVER }}-${{ hashFiles('helper/**') }}
- name: Set up Python
if: steps.cache-helper.outputs.cache-hit != 'true'
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYVER }}
- name: Install dependencies - name: Install dependencies
if: steps.cache-helper.outputs.cache-hit != 'true'
run: | run: |
brew update brew update
brew install swig brew install swig
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install poetry pip install poetry
- name: Build the Helper
if: steps.cache-helper.outputs.cache-hit != 'true'
run: ./build-helper.sh
- uses: subosito/flutter-action@v2 - uses: subosito/flutter-action@v2
with: with:
channel: 'stable' channel: 'stable'
@ -40,9 +57,6 @@ jobs:
flutter test flutter test
flutter analyze flutter analyze
- name: Build the Helper
run: ./build-helper.sh
- name: Build the app - name: Build the app
run: | run: |
export VERSION_NAME=`./set-version.py | head -n 1 | sed 's/-.*$//g'` export VERSION_NAME=`./set-version.py | head -n 1 | sed 's/-.*$//g'`

View File

@ -6,26 +6,40 @@ jobs:
build: build:
runs-on: windows-latest runs-on: windows-latest
env:
PYVER: 3.11
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Check app versions - name: Check app versions
run: | run: |
python set-version.py python set-version.py
git diff --exit-code git diff --exit-code
- name: Cache helper
id: cache-helper
uses: actions/cache@v3
with:
path: |
build/windows/helper
assets/licenses/helper.json
key: ${{ runner.os }}-py${{ env.PYVER }}-${{ hashFiles('helper/**') }}
- name: Set up Python
if: steps.cache-helper.outputs.cache-hit != 'true'
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYVER }}
- name: Install dependencies - name: Install dependencies
if: steps.cache-helper.outputs.cache-hit != 'true'
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install poetry pip install poetry
- name: Build the Helper - name: Build the Helper
if: steps.cache-helper.outputs.cache-hit != 'true'
run: | run: |
# Needed to shorten the path for zxing-cpp build # Needed to shorten the path for zxing-cpp build
$env:TMPDIR = "C:\e" $env:TMPDIR = "C:\e"
@ -59,7 +73,6 @@ jobs:
cp $dest\helper\VCRUNTIME140.dll $dest\ cp $dest\helper\VCRUNTIME140.dll $dest\
cp $dest\helper\VCRUNTIME140_1.dll $dest\ cp $dest\helper\VCRUNTIME140_1.dll $dest\
- name: Create an unsigned .msi installer package - name: Create an unsigned .msi installer package
run: | run: |
$env:PATH += ";$env:WIX\bin" $env:PATH += ";$env:WIX\bin"