From b9648fee9eb9e08e980b025ae0ed2b35e473e2ab Mon Sep 17 00:00:00 2001 From: aydiler Date: Sun, 24 May 2026 14:07:06 +0200 Subject: [PATCH] ci: add manual workflow to push snap store metadata One-shot resync for cases where the snap store description has drifted from snap/snapcraft.yaml (e.g. when a release predates the auto-push step added in PR #25). Trigger via 'gh workflow run snap-push-metadata.yml'. The release.yml publish-snap job handles this automatically from v0.1.12 onward; this workflow exists for manual one-offs. --- .github/workflows/snap-push-metadata.yml | 50 ++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/snap-push-metadata.yml diff --git a/.github/workflows/snap-push-metadata.yml b/.github/workflows/snap-push-metadata.yml new file mode 100644 index 0000000..fc300a9 --- /dev/null +++ b/.github/workflows/snap-push-metadata.yml @@ -0,0 +1,50 @@ +name: Push Snap Store Metadata + +# Manual-only workflow that pushes the snap/snapcraft.yaml description and +# summary to the Snap Store listing. The release.yml publish-snap job does +# this automatically on every release tag from v0.1.12 onward; this workflow +# exists for one-off resyncs (e.g. v0.1.11 shipped before that auto-push +# step was wired in, so the store description lagged the yaml). +# +# Trigger via: gh workflow run snap-push-metadata.yml + +on: + workflow_dispatch: + +jobs: + push-metadata: + name: Push snap metadata + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: read + env: + SNAP_CREDS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} + steps: + - name: Check Snap Store credentials + id: check + run: | + if [ -z "$SNAP_CREDS" ]; then + echo "::error::SNAPCRAFT_STORE_CREDENTIALS not set" + exit 1 + fi + + - uses: actions/checkout@v4 + + - name: Install snapcraft + snap CLI + run: | + sudo snap install snapcraft --classic + # `snap download` is part of snapd on the runner + + - name: Download latest published snap + run: | + snap download md-viewer --channel=stable + ls -lh md-viewer_*.snap + + - name: Push metadata from snapcraft.yaml + run: | + SNAP_FILE=$(ls md-viewer_*.snap | head -1) + echo "Pushing metadata from snap file: $SNAP_FILE" + snapcraft push-metadata "$SNAP_FILE" --from-yaml --force + env: + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}