Skip to content

デプロイ(linux) #42

デプロイ(linux)

デプロイ(linux) #42

Workflow file for this run

name: デプロイ(linux)
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-latest
strategy:
matrix:
platform: [amd64, 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 ${{ 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
strategy:
matrix:
platform: [amd64]
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: Get Build Version
run: |
echo "VERSION=$(yq -r '.version' pubspec.yaml)" >> $GITHUB_ENV
- 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 mpv
sudo pip3 install meson
- run: flutter pub get
- run: flutter pub global activate flutter_distributor
#- run: flutter test
- run: flutter_distributor package --platform=linux --targets=deb --skip-clean
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: release-x64.deb
path: ./dist/${{ env.VERSION }}/*deb