-
-
Notifications
You must be signed in to change notification settings - Fork 412
111 lines (98 loc) · 3.6 KB
/
Copy pathbuild-linux.yml
File metadata and controls
111 lines (98 loc) · 3.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
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 }}