Files
OpenShell/.github/workflows/snap-publish.yml
Simon Scatton 07a05f856a fix(ci): gate tagged publication on qualification (#4198)
* fix(ci): gate tagged publication on qualification

Signed-off-by: Simon Scatton <sscatton@nvidia.com>

* test(ci): remove release publication regression scaffolding

Signed-off-by: Simon Scatton <sscatton@nvidia.com>

* refactor(ci): separate snap packaging from publication

Signed-off-by: Simon Scatton <sscatton@nvidia.com>

---------

Signed-off-by: Simon Scatton <sscatton@nvidia.com>
2026-10-05 14:00:00 +00:00

75 lines
2.1 KiB
YAML

# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
name: Publish Snap
on:
workflow_call:
inputs:
upload-channel:
required: true
type: string
github-environment:
required: true
type: string
secrets:
publish-credentials:
required: true
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
publish:
name: Publish Snap (Linux ${{ matrix.arch }})
strategy:
matrix:
include:
- arch: amd64
runner: linux-amd64-cpu8
- arch: arm64
runner: linux-arm64-cpu8
runs-on: ${{ matrix.runner }}
timeout-minutes: 10
environment: ${{ inputs.github-environment }}
steps:
- name: Download built snap and components
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: snap-linux-${{ matrix.arch }}
- name: Install snapcraft
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y snapd
sudo systemctl enable --now snapd.socket
sudo systemctl start snapd
sudo snap wait system seed.loaded
sudo snap install snapcraft --classic
- name: Upload snap to Snap Store
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.publish-credentials }}
INPUTS_UPLOAD_CHANNEL: ${{ inputs.upload-channel }}
run: |
set -euo pipefail
shopt -s nullglob
snaps=(*.snap)
if [[ "${#snaps[@]}" -ne 1 ]]; then
echo "Expected exactly one built snap, found ${#snaps[@]}" >&2
exit 1
fi
snap_file="${snaps[0]}"
snap_name="${snap_file%.snap}"
snap_name="${snap_name%%_*}"
component_args=()
for comp in "${snap_name}"+*.comp; do
component_args+=(--component "$comp")
done
snapcraft upload --release "${INPUTS_UPLOAD_CHANNEL}" "$snap_file" "${component_args[@]}"