From 4f609f296dffd7047ac110cceda7be62626644c5 Mon Sep 17 00:00:00 2001 From: Arenukvern Date: Wed, 6 Mar 2024 02:32:05 +0200 Subject: [PATCH] feat: snapstore workflow --- .github/wip/release_snapstore.workflow.yml | 13 ----- .../workflows/release_snapstore.workflow.yml | 51 +++++++++++++++++++ 2 files changed, 51 insertions(+), 13 deletions(-) delete mode 100644 .github/wip/release_snapstore.workflow.yml create mode 100644 .github/workflows/release_snapstore.workflow.yml diff --git a/.github/wip/release_snapstore.workflow.yml b/.github/wip/release_snapstore.workflow.yml deleted file mode 100644 index 547fa539..00000000 --- a/.github/wip/release_snapstore.workflow.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Snapstore Build -on: - release: - types: [created] - push: - branches: - - master -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: snapcore/action-build@v1 diff --git a/.github/workflows/release_snapstore.workflow.yml b/.github/workflows/release_snapstore.workflow.yml new file mode 100644 index 00000000..6459eb10 --- /dev/null +++ b/.github/workflows/release_snapstore.workflow.yml @@ -0,0 +1,51 @@ +name: Snapstore Build +on: + release: + types: [created] + push: + branches: + - release/snapstore + workflow_dispatch: + workflow_call: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Flutter + uses: subosito/flutter-action@v2 + with: + channel: "stable" + - name: Install Snapcraft + uses: samuelmeuli/action-snapcraft@v2 + - name: Building snap + run: | + snapcraft + # Make sure the snap is installable + - name: Test snap installation + run: | + sudo snap install ./last-answer.snap –dangerous + - name: Save snap for reuse + uses: actions/upload-artifact@v4 + with: + name: last-answer-snap + path: ./last-answer.snap + + publish: + # if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + needs: build + steps: + - name: Download snap + uses: actions/download-artifact@v3 + with: + name: last-answer-snap + path: . + - name: Publish to Snapstore Edge + uses: snapcore/action-publish@v1 + env: + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_LOGIN }} + with: + snap: ./last-answer.snap + release: edge