Skip to content

Commit

Permalink
fix release stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
jippi committed Feb 3, 2024
1 parent 1b1665f commit 16d2682
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 28 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ jobs:
# - name: snapcraft-login
# if: startsWith(github.ref, 'refs/tags/v')
# run: snapcraft login --with <(echo "${{ secrets.SNAPCRAFT_LOGIN }}")
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
install-only: true
- name: goreleaser-release
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ dottie.exe
.task/
.idea/
.direnv

manpages/
completions/
43 changes: 17 additions & 26 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ metadata:
mod_timestamp: "{{ .CommitTimestamp }}"

builds:
- env:
- main: ./cmd/
env:
- CGO_ENABLED=0
goos:
- linux
Expand Down Expand Up @@ -94,44 +95,40 @@ dockers:
- image_templates:
# - "jippi/dottie:v{{ .Version }}-amd64"
- "ghcr.io/jippi/dottie:v{{ .Version }}-amd64"
dockerfile: Dockerfile
dockerfile: Dockerfile.release
use: buildx
build_flag_templates:
- "--pull"
- "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/jippi/dottie/main/README.md"
- "--label=io.artifacthub.package.logo-url=https://goreleaser.com/static/avatar.png"
- '--label=io.artifacthub.package.maintainers=[{"name":"Carlos Alexandro Becker","email":"carlos@carlosbecker.dev"}]'
- '--label=io.artifacthub.package.maintainers=[{"name":"Christian Winther","email":"dottie@jippi.dev"}]'
- "--label=io.artifacthub.package.license=MIT"
- "--label=org.opencontainers.image.description=Deliver Go binaries as fast and easily as possible"
- "--label=org.opencontainers.image.description=Easy .env files"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
- "--platform=linux/amd64"
extra_files:
- scripts/entrypoint.sh
- image_templates:
- "jippi/dottie:v{{ .Version }}-arm64"
# - "jippi/dottie:v{{ .Version }}-arm64"
- "ghcr.io/jippi/dottie:v{{ .Version }}-arm64"
dockerfile: Dockerfile
dockerfile: Dockerfile.release
use: buildx
build_flag_templates:
- "--pull"
- "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/jippi/dottie/main/README.md"
- "--label=io.artifacthub.package.logo-url=https://goreleaser.com/static/avatar.png"
- '--label=io.artifacthub.package.maintainers=[{"name":"Carlos Alexandro Becker","email":"carlos@carlosbecker.dev"}]'
- '--label=io.artifacthub.package.maintainers=[{"name":"Christian Winther","email":"dottie@jippi.dev"}]'
- "--label=io.artifacthub.package.license=MIT"
- "--label=org.opencontainers.image.description=Deliver Go binaries as fast and easily as possible"
- "--label=org.opencontainers.image.description=Easy .env files"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
- "--platform=linux/arm64"
goarch: arm64
extra_files:
- scripts/entrypoint.sh
# extra_files:
# - scripts/entrypoint.sh

docker_manifests:
# - name_template: "jippi/dottie:v{{ .Version }}"
Expand Down Expand Up @@ -175,7 +172,7 @@ archives:
owner: root
files:
- README.md
- LICENSE.md
- LICENSE
- completions/*
- manpages/*
Expand All @@ -190,11 +187,7 @@ brews:
license: MIT
test: |
system "#{bin}/dottie -v"
dependencies:
- name: go
type: optional
- name: git
type: optional
dependencies: []
extra_install: |-
bash_completion.install "completions/dottie.bash" => "goreleaser"
zsh_completion.install "completions/dottie.zsh" => "_goreleaser"
Expand Down Expand Up @@ -245,7 +238,7 @@ brews:
# install -Dm755 "./goreleaser" "${pkgdir}/usr/bin/goreleaser"

# # license
# install -Dm644 "./LICENSE.md" "${pkgdir}/usr/share/licenses/goreleaser/LICENSE"
# install -Dm644 "./LICENSE" "${pkgdir}/usr/share/licenses/goreleaser/LICENSE"

# # completions
# mkdir -p "${pkgdir}/usr/share/bash-completion/completions/"
Expand Down Expand Up @@ -295,7 +288,7 @@ nfpms:
dst: /usr/share/man/man1/dottie.1.gz
file_info:
mode: 0644
- src: ./LICENSE.md
- src: ./LICENSE
dst: /usr/share/doc/dottie/copyright
file_info:
mode: 0644
Expand All @@ -304,10 +297,8 @@ nfpms:
- deb
- rpm
- archlinux
dependencies:
- git
recommends:
- golang
dependencies: []
recommends: []
deb:
lintian_overrides:
- statically-linked-binary
Expand Down
8 changes: 8 additions & 0 deletions Dockerfile.release
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# syntax=docker/dockerfile:1
# See https://hub.docker.com/r/docker/dockerfile

FROM scratch

ENTRYPOINT ["/dottie"]

COPY dottie /
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Dottie

TODO
2 changes: 1 addition & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ tasks:
SNAPSHOT:
sh: 'if [[ $GITHUB_REF != refs/tags/v* ]]; then echo "--snapshot"; fi'
cmds:
- ./goreleaser release --clean --timeout 60m {{ .SNAPSHOT }}
- goreleaser release --clean --timeout 60m {{ .SNAPSHOT }}

nightly:
cmds:
Expand Down
2 changes: 1 addition & 1 deletion scripts/completions.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ rm -rf completions
mkdir completions

for sh in bash fish ps zsh; do
go run ./cmd/ completion "$sh" >"completions/dottie.$sh"
go run ./cmd/ completions "$sh" >"completions/dottie.$sh"
done
Empty file modified scripts/manpages.sh
100644 → 100755
Empty file.

0 comments on commit 16d2682

Please sign in to comment.