Skip to content

Commit

Permalink
wip: snap CD
Browse files Browse the repository at this point in the history
  • Loading branch information
jzelinskie committed Apr 22, 2024
1 parent 1839049 commit 779288f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@ jobs:
HOMEBREW_TAP_GITHUB_TOKEN: "${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}"
GORELEASER_KEY: "${{ secrets.GORELEASER_KEY }}"
GEMFURY_PUSH_TOKEN: "${{ secrets.GEMFURY_PUSH_TOKEN }}"
- name: "Release snap"
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
run: |
snapcraft upload dist/*_amd64.snap --release stable
snapcraft upload dist/*_arm64.snap --release stable
4 changes: 4 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ snapcrafts:
confinement: "strict"
license: "Apache-2.0"
base: "core22"
extra_files:
- source: "completions/spicedb.snap"
destination: "completions/spicedb.snap"
mode: 0755
apps:
spicedb:
command: "spicedb"
Expand Down
10 changes: 8 additions & 2 deletions magefiles/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,13 @@ func (Gen) Completions() error {
return err
}

for _, shell := range []string{"bash", "zsh", "fish"} {
f, err := os.Create("./completions/spicedb." + shell)
for filetype, shell := range map[string]string{
"bash": "bash",
"snap": "bash",
"zsh": "zsh",
"fish": "fish",
} {
f, err := os.Create("./completions/spicedb." + filetype)
if err != nil {
return err
}
Expand All @@ -47,5 +52,6 @@ func (Gen) Completions() error {
return err
}
}

return nil
}

0 comments on commit 779288f

Please sign in to comment.