name: Snap Package
on:
workflow_dispatch:
permissions:
contents: write
jobs:
snap:
name: Build Snap Package
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Build snap
uses: snapcore/action-build@3bdaa03e89fbf4598ba4c501055a582c77b6a75a id: build
- name: Upload snap artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f with:
name: snap-package
path: ${{ steps.build.outputs.snap }}
retention-days: 90
- name: Upload to release
if: github.event_name == 'release'
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b with:
files: ${{ steps.build.outputs.snap }}
- name: Publish to Snap Store
if: github.event_name == 'release' && github.ref == 'refs/heads/main'
uses: snapcore/action-publish@2f62f3ca778de25a88f1e29edb6ec4e763e53eef env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
with:
snap: ${{ steps.build.outputs.snap }}
release: stable