forked from shiosyakeyakini-info/miria
-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (113 loc) · 4.53 KB
/
linux_deploy_arm.yml
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: デプロイ(linux ARM)
on:
workflow_dispatch:
inputs:
job_to_run:
description: "ビルドを行うパッケージ"
required: true
type: choice
options:
- all
- snap
- deb
env:
APP_NAME: 'miria'
MAINTAINER: 'sorairo <[email protected]>'
permissions:
contents: write
jobs:
build-snap:
name: ビルド(Snap)
if: ${{ github.event.inputs.job_to_run == 'snap' || github.event.inputs.job_to_run == 'all' }}
runs-on: ubuntu-24.04-arm
strategy:
matrix:
platform: [arm64]
outputs:
snap: ${{ steps.snapcraft.outputs.snap }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Build Snap
id: snapcraft
uses: diddlesnaps/snapcraft-multiarch-action@v1
with:
architecture: ${{ matrix.platform }}
- name: Get Build Version
run: |
echo "VERSION=$(yq -r '.version' pubspec.yaml)" >> $GITHUB_ENV
- name: Upload snap
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload v$VERSION --clobber ${{ steps.snapcraft.outputs.snap }}
# https://gihyo.jp/admin/serial/01/ubuntu-recipe/0660#sec3 : Snapパッケージアップロードまでの流れ
# https://github.com/snapcore/action-publish : Snap ActionのREADME.md
# Snap Storeでパッケージ名"miria"を予約($ snapcraft register miria)後、"SNAPCRAFT_STORE_CREDENTIALS"を登録し、
# 以下をコメントアウトを解除することでSnap Storeへアップロードすることが可能です。
# 通常、SnapファイルをそのままStore外で公開することはありません。
#
#- name: Upload Snap Store
# uses: snapcore/action-publish@v1
# env:
# SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
# with:
# snap: ${{ steps.snapcraft.outputs.snap }}
# release: stable
build-debs:
name: ビルド(Deb)
if: ${{ github.event.inputs.job_to_run == 'deb' || github.event.inputs.job_to_run == 'all' }}
runs-on: ubuntu-22.04-arm64
strategy:
matrix:
platform: [arm64]
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Get Flutter version from .fvmrc
run: echo "FLUTTER_FVM_VERSION=$(jq -r .flutter .fvmrc)" >> $GITHUB_ENV
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_FVM_VERSION }}
cache: true
architecture: x64
- name: Patch for linux build
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev libsecret-1-dev libstdc++-12-dev nasm libmpv-dev
sudo pip3 install meson
- run: flutter pub get
# - run: flutter test
- run: flutter build linux --target-platform linux-arm64
- name: Get Build Version
run: |
echo "VERSION=$(yq -r '.version' pubspec.yaml)" >> $GITHUB_ENV
- name: Prepare to build DEB
run: |
mkdir -p .debpkg/opt/miria .debpkg/usr/share/applications .debpkg/usr/share/pixmaps .debpkg/usr/bin
cp -rp ./build/linux/x64/release/bundle/* .debpkg/opt/miria/
cp ./snap/gui/miria.desktop .debpkg/usr/share/applications/
cp ./assets/images/icon.png .debpkg/usr/share/pixmaps/miria.png
ln -s /opt/miria/miria .debpkg/usr/bin/miria
chmod a+x .debpkg/usr/bin/miria
sed -i -E 's|^Version=.*|Version=1.5|g' .debpkg/usr/share/applications/miria.desktop
sed -i -E 's|^Icon=.*|Icon=miria|g' .debpkg/usr/share/applications/miria.desktop
echo "DESC=$(awk -F '=' '/^Comment=/{print $2}' .debpkg/usr/share/applications/miria.desktop)" >> $GITHUB_ENV
- name: Build DEB
uses: jiro4989/build-deb-action@v3
with:
desc: '${{ env.DESC }}'
package: ${{ env.APP_NAME }}
maintainer: ${{ env.MAINTAINER }}
version: ${{ env.VERSION }}
arch: "amd64"
package_root: ".debpkg"
depends: "libgtk-3-0, libstdc++6, libx11-6, libmpv1 | libmpv2, libsecret-1-0"
- name: Upload DEB
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload v$VERSION --clobber ./miria_${{ env.VERSION }}_arm64.deb