Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
4ster1sk committed Jan 17, 2025
1 parent 78248c3 commit 3936742
Showing 1 changed file with 128 additions and 0 deletions.
128 changes: 128 additions & 0 deletions .github/workflows/linux_deploy_arm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@

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-24.04-arm
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

- 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
- 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

0 comments on commit 3936742

Please sign in to comment.