From 2d32f96327902eb31fdf93643f0631ff0bb61a24 Mon Sep 17 00:00:00 2001 From: Npepperlinux Date: Fri, 1 Dec 2023 00:16:12 +0900 Subject: [PATCH] =?UTF-8?q?Snap=E3=83=91=E3=83=83=E3=82=B1=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=83=93=E3=83=AB=E3=83=89=E3=81=AE=E3=83=AF=E3=83=BC?= =?UTF-8?q?=E3=82=AF=E3=83=95=E3=83=AD=E3=83=BC=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/snap_deploy.yml | 56 +++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/snap_deploy.yml diff --git a/.github/workflows/snap_deploy.yml b/.github/workflows/snap_deploy.yml new file mode 100644 index 000000000..bc84e539e --- /dev/null +++ b/.github/workflows/snap_deploy.yml @@ -0,0 +1,56 @@ +name: デプロイ(snap) +on: + workflow_dispatch: + release: + types: [published] + +permissions: + contents: write + +jobs: + build: + 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=$(cat pubspec.yaml | grep version | cut -d ' ' -f 2)" >> $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_STORE_CREDENTIALS"を登録し、 + # 以下をコメントアウトを解除することでSnap Storeへアップロードすることが可能です。 + # Snap Storeでの公開後は、上記の"Upload snap"をコメントアウトしてください。 + # (通常、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 +