build(snap): publish nightly version to snapcraft via actions (#37814)

The secret is added to the repo already.

Right now this only publishes commits to main branch to the
"latest/edge" snap channel, but if this is successful we can add more
workflows/logic to be able to publish RCs/fully tagged versions too.

---------

Co-authored-by: Nicolas <bircni@icloud.com>
This commit is contained in:
techknowlogick
2026-05-22 15:27:09 -04:00
committed by GitHub
parent f95c210abe
commit 12fcd78e8e

View File

@@ -0,0 +1,41 @@
name: release-nightly-snapcraft
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
build-and-publish:
runs-on: ubuntu-latest
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install snapcraft
run: sudo snap install snapcraft --classic
- name: Remote build
run: |
snapcraft remote-build \
--launchpad-accept-public-upload \
--build-for=amd64,arm64,armhf
- name: List built snaps
run: find . -maxdepth 1 -type f -name '*.snap' -print
- name: Upload and release snapcraft nightly build
run: |
set -euo pipefail
for snap in ./*.snap; do
echo "Uploading $snap to edge"
snapcraft upload --release="latest/edge" "$snap"
done