Skip to content

Commit

Permalink
t
Browse files Browse the repository at this point in the history
  • Loading branch information
Npepperlinux committed Nov 19, 2024
1 parent 62d2514 commit 5c52342
Showing 1 changed file with 10 additions and 48 deletions.
58 changes: 10 additions & 48 deletions .github/workflows/linux_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: デプロイ(linux)
on:
workflow_dispatch:
push:
release:
types: [published]

Expand All @@ -13,50 +14,6 @@ permissions:
contents: write

jobs:
build-snap:
name: ビルド(Snap)
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)
runs-on: ubuntu-latest
Expand Down Expand Up @@ -113,11 +70,16 @@ jobs:
- name: Prepare to build DEB
run: |
mkdir -p .debpkg/opt/miria .debpkg/usr/share/applications .debpkg/usr/share/pixmaps .debpkg/usr/bin
mkdir -p .debpkg/opt/miria/usr/lib .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
cat << END > .debpkg/usr/bin/miria
#!/bin/bash
export LD_LIBRARY_PATH=/opt/miria/usr/lib:$LD_LIBRARY_PATH
cp /usr/local/lib/libmpv.so* .debpkg/opt/miria/usr/lib/
exec -a "$0" "/opt/miria/miria" "$@"
END
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
Expand All @@ -130,10 +92,10 @@ jobs:
version: ${{ env.VERSION }}
arch: "amd64"
package_root: ".debpkg"
depends: "libgtk-3-0, libstdc++6, libx11-6, libmpv2, libsecret-1-0"
depends: "libgtk-3-0, libstdc++6, libx11-6, libsecret-1-0"

- name: Upload DEB
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload v$VERSION ./miria_${{ env.VERSION }}_amd64.deb
gh release create --draft v$VERSION ./miria_${{ env.VERSION }}_amd64.deb

0 comments on commit 5c52342

Please sign in to comment.