Skip to content

Commit

Permalink
Add support to snap packages
Browse files Browse the repository at this point in the history
Closes #351
  • Loading branch information
mhalano committed Dec 16, 2023
1 parent 11c19c0 commit 407b9e4
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: '1.20'
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v2
- name: Setup Snapcraft
run: |
# https://github.com/goreleaser/goreleaser/issues/1715
# https://bugs.launchpad.net/snapcraft/+bug/1889741
mkdir -p "${HOME}/.cache/snapcraft/download"
mkdir -p "${HOME}/.cache/snapcraft/stage-packages"
- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
Expand Down Expand Up @@ -57,3 +65,7 @@ jobs:
run: COMMAND=./dist/kubectx_linux_amd64_v1/kubectx bats test/kubectx.bats
- name: kubens (Go) integration tests
run: COMMAND=./dist/kubens_linux_amd64_v1/kubens bats test/kubens.bats
- name: Publish Snaps to the Snap Store (edge channel)
run: for snap in $(ls ./dist/*.snap); do snapcraft upload --release=edge $snap; done
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
10 changes: 10 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
17 changes: 17 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 407b9e4

Please sign in to comment.