Files
flutter/.github/workflows/build-linux.yml
dependabot[bot] 4db33865df Bump actions/checkout from 6 to 7
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-19 00:52:32 +00:00

112 lines
3.6 KiB
YAML

name: Build Linux
on:
workflow_dispatch:
inputs:
ref:
description: 'Branch/Tag to build'
required: true
default: 'master'
generate_manifest:
description: 'Update flathub manifest'
type: boolean
default: false
workflow_call:
inputs:
ref:
required: true
type: string
generate_manifest:
type: boolean
default: true
secrets:
SSH_DEPLOY_KEY:
required: true
permissions:
contents: read
jobs:
# TODO: note that we currently only build for x64, as arm64 is not supported by
# subosito/flutter-action@v2 yet and we don't want to install flutter manually
# just for this workflow: https://github.com/subosito/flutter-action/issues/345
build_linux:
name: Build application - ${{ matrix.platform }}
runs-on: ${{ matrix.runner }}
outputs:
flutter_sdk_version: ${{ steps.flutter-version.outputs.flutter_sdk_version }}
strategy:
matrix:
include:
- platform: x64
runner: ubuntu-latest
# - platform: arm64
# runner: ubuntu-24.04-arm
steps:
- name: Checkout application
uses: actions/checkout@v7
with:
ref: ${{ inputs.ref }}
- name: Read Flutter SDK version
id: flutter-version
run: |
flutter_sdk_version=$(grep 'flutter-version:' .github/actions/flutter-common/action.yml | awk '{print $2}')
echo "flutter_sdk_version=$flutter_sdk_version" >> "$GITHUB_OUTPUT"
- name: Common setup
uses: ./.github/actions/flutter-common
# https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md
- name: Build application for linux
run: |
sudo apt update
sudo apt install -y pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev libsecret-1-dev libjsoncpp-dev --no-install-recommends
flutter build linux --release
tar -zcvf linux-${{ matrix.platform }}.tar.gz build/linux/${{ matrix.platform }}/release/bundle
- uses: actions/upload-artifact@v7
with:
name: builds-linux
path: |
linux-${{ matrix.platform }}.tar.gz
generate_flathub_manifest:
runs-on: ubuntu-latest
name: Update flathub manifest
if: ${{ inputs.generate_manifest }}
# If the job fails just continue, this can be done manually later
continue-on-error: true
needs:
- build_linux
steps:
- name: Checkout flatpak-flathub repo
uses: actions/checkout@v7
with:
repository: wger-project/de.wger.flutter
- name: Bump version and update manifest
run: |
git clone https://github.com/TheAppgineer/flatpak-flutter.git --branch 0.14.1 ../flatpak-flutter
pip install -r ../flatpak-flutter/requirements.txt
python bump-versions.py ${{ inputs.ref }} ${{ needs.build_linux.outputs.flutter_sdk_version }}
../flatpak-flutter/flatpak-flutter.py --app-module wger flatpak-flutter.yml
- name: Push updated config to flathub repository
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
run: |
mkdir -p ~/.ssh
echo "$SSH_DEPLOY_KEY" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan github.com >> ~/.ssh/known_hosts
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git checkout -b release-${{ inputs.ref }}
git add -A
git commit -m "Update to ${{ inputs.ref }}"
git push origin release-${{ inputs.ref }}