Skip to content

Commit

Permalink
goreleaser: added snapcraft
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Sep 17, 2023
1 parent ff88156 commit ade66ad
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 12 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ jobs:

build:
runs-on: ubuntu-latest
container: ghcr.io/rsteube/carapace
steps:
- name: shallow clone
uses: actions/checkout@v3
Expand Down Expand Up @@ -49,17 +48,27 @@ jobs:
- name: "carapace-lint"
run: go run ./cmd/carapace-lint completers/*/cmd/*.go

- name: setup-snapcraft
if: startsWith(github.ref, 'refs/tags/')
# FIXME: the mkdirs are a hack for https://github.com/goreleaser/goreleaser/issues/1715
run: |
sudo apt-get update
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
mkdir -p $HOME/.cache/snapcraft/download
mkdir -p $HOME/.cache/snapcraft/stage-packages
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AUR_KEY: ${{ secrets.AUR_KEY }}
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
GORELEASER_GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}

doc:
runs-on: ubuntu-latest
Expand Down
30 changes: 20 additions & 10 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,30 @@ changelog:
exclude:
- '^docs:'
- '^test:'

brews:
-
name: carapace
description: "multi-shell multi-command argument completer"
homepage: "https://github.com/rsteube/carapace-bin"
license: "MIT"
tap:
repository:
owner: rsteube
name: homebrew-tap
token: "{{ .Env.GORELEASER_GITHUB_TOKEN }}"
commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}"
scoop:
description: "multi-shell multi-command argument completer"
homepage: "https://github.com/rsteube/carapace-bin"
license: "MIT"
bucket:
owner: rsteube
name: scoop-bucket
token: "{{ .Env.GORELEASER_GITHUB_TOKEN }}"
commit_msg_template: "Scoop update for {{ .ProjectName }} version {{ .Tag }}"

scoops:
-
description: "multi-shell multi-command argument completer"
homepage: "https://github.com/rsteube/carapace-bin"
license: "MIT"
repository:
owner: rsteube
name: scoop-bucket
token: "{{ .Env.GORELEASER_GITHUB_TOKEN }}"
commit_msg_template: "Scoop update for {{ .ProjectName }} version {{ .Tag }}"

aurs:
-
description: "multi-shell multi-command argument completer"
Expand All @@ -75,6 +79,12 @@ nfpms:
- rpm
- termux.deb

snapcrafts:
-
summary: "multi-shell multi-command argument completer"
description: "multi-shell multi-command argument completer"
license: "MIT"

publishers:
- name: fury
cmd: "bash -c \"[[ {{.ArtifactPath}} =~ ^.*.(deb|rpm)$ ]] && curl -F package=@{{abs .ArtifactPath}} https://[email protected]/rsteube/ || true\""
Expand Down

0 comments on commit ade66ad

Please sign in to comment.