From 9d9f27ba17326befce6e214dc30aba0e722fb511 Mon Sep 17 00:00:00 2001 From: Marcos Alano Date: Sat, 16 Dec 2023 10:31:59 -0300 Subject: [PATCH] Add support to snap packages Closes #351 --- .github/workflows/release.yml | 10 ++++++++++ .goreleaser.yml | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 35aea87..d4c716f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,6 +27,12 @@ jobs: uses: actions/setup-go@v2 with: go-version: '1.20' + - name: Install Snapcraft + uses: samuelmeuli/action-snapcraft@v1 + - name: Setup Snapcraft + run: | + mkdir -p $HOME/.cache/snapcraft/download + mkdir -p $HOME/.cache/snapcraft/stage-packages - name: GoReleaser uses: goreleaser/goreleaser-action@v2 with: @@ -42,3 +48,7 @@ jobs: uses: rajatjindal/krew-release-bot@v0.0.38 with: krew_template_file: .krew/ns.yaml + - name: Publish Snaps to the Snap Store (stable channel) + run: for snap in $(ls dist/*.snap); do snapcraft upload --release=stable $snap; done + env: + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index ecfca8d..dec3285 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -98,3 +98,20 @@ release: extra_files: - glob: ./kubens - glob: ./kubectx +snapcrafts: + - id: kubectx + name: kubectx + summary: 'kubectx + kubens: Power tools for kubectl' + description: | + kubectx is a tool to switch between contexts (clusters) on kubectl faster. + kubens is a tool to switch between Kubernetes namespaces (and configure them for kubectl) easily. + grade: stable + confinement: classic + base: core20 + apps: + kubectx: + command: kubectx + completer: completion/kubectx.bash + kubens: + command: kubens + completer: completion/kubens.bash