Skip to content

dev: publish AUR from sources #5241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 44 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ aurs:
skip_upload: false
homepage: https://golangci.com
provides:
- "golangci-lint"
- "golangci-lint-bin"
maintainers:
- "Fernandez Ludovic <lfernandez dot dev at gmail dot com>"
license: GPL-3.0
Expand All @@ -172,6 +172,49 @@ aurs:
./golangci-lint completion zsh | install -Dm644 /dev/stdin "${pkgdir}/usr/share/zsh/site-functions/_golangci-lint"
./golangci-lint completion fish | install -Dm644 /dev/stdin "${pkgdir}/usr/share/fish/vendor_completions.d/golangci-lint.fish"

aur_sources:
- description: Fast linters runner for Go.
skip_upload: false
homepage: https://golangci.com
provides:
- "golangci-lint"
maintainers:
- "Fernandez Ludovic <lfernandez dot dev at gmail dot com>"
license: GPL-3.0
private_key: "{{ .Env.AUR_KEY }}"
git_url: "ssh://[email protected]/golangci-lint.git"
commit_author:
name: golangci-releaser
email: [email protected]
build: |-
local _commit _flags
_commit=$(bsdcat "${pkgname}-${pkgver}.tar.gz" | git get-tar-commit-id)
_flags=(
-X=main.version="$pkgver"
-X=main.commit="${_commit::7}"
-X=main.date="$(date -u -d "@${SOURCE_DATE_EPOCH}" +'%FT%TZ')"
-linkmode=external
)
export CGO_ENABLED=1
export CGO_CFLAGS="${CFLAGS}"
export CGO_CPPFLAGS="$CPPFLAGS"
export CGO_CXXFLAGS="$CXXFLAGS"
export CGO_LDFLAGS="${LDFLAGS}"
export GOFLAGS='-buildmode=pie -trimpath -modcacherw'

cd "$pkgname-$pkgver"

go build -o "$pkgname" -ldflags="${_flags[*]}" ./cmd/"$pkgname"
./"$pkgname" completion bash > completion.bash
./"$pkgname" completion zsh > completion.zsh
./"$pkgname" completion fish > completion.fish
package: |-
cd "${pkgname}-${pkgver}"
install -Dm755 "$pkgname" -t "$pkgdir"/usr/bin
install -Dm644 completion.bash "$pkgdir"/usr/share/bash-completion/completions/"$pkgname"
install -Dm644 completion.zsh "$pkgdir"/usr/share/zsh/site-functions/_"$pkgname"
install -Dm644 completion.fish "$pkgdir"/usr/share/fish/vendor_completions.d/"$pkgname".fish

snapcrafts:
- summary: Fast linters runner for Go.
description: |
Expand Down
Loading