name: snap

on: [workflow_dispatch]

jobs:
  snap:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          ref: master

      - name: Set up Go
        uses: actions/setup-go@v3
        with:
          go-version: 1.21

      - uses: snapcore/action-build@v1
        id: build

      - uses: snapcore/action-publish@v1
        env:
          SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.MY_SNAPCRAFT_CREDENTIALS }}
        with:
          snap: ${{ steps.build.outputs.snap }}
          release: stable
