From 16d268233aa1eaf996e9899c5591bf44a56f6664 Mon Sep 17 00:00:00 2001 From: Christian Winther Date: Sat, 3 Feb 2024 16:00:22 +0100 Subject: [PATCH] fix release stuff --- .github/workflows/release.yml | 4 ++++ .gitignore | 3 +++ .goreleaser.yaml | 43 ++++++++++++++--------------------- Dockerfile.release | 8 +++++++ README.md | 3 +++ Taskfile.yml | 2 +- scripts/completions.sh | 2 +- scripts/manpages.sh | 0 8 files changed, 37 insertions(+), 28 deletions(-) create mode 100644 Dockerfile.release create mode 100644 README.md mode change 100644 => 100755 scripts/completions.sh mode change 100644 => 100755 scripts/manpages.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9d6afa9..9209d9e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/.gitignore b/.gitignore index 2b969ff..824187c 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ dottie.exe .task/ .idea/ .direnv + +manpages/ +completions/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml index adcd0fe..4a8b0c3 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -27,7 +27,8 @@ metadata: mod_timestamp: "{{ .CommitTimestamp }}" builds: - - env: + - main: ./cmd/ + env: - CGO_ENABLED=0 goos: - linux @@ -94,35 +95,31 @@ 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}}" @@ -130,8 +127,8 @@ dockers: - "--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 }}" @@ -175,7 +172,7 @@ archives: owner: root files: - README.md - - LICENSE.md + - LICENSE - completions/* - manpages/* @@ -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" @@ -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/" @@ -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 @@ -304,10 +297,8 @@ nfpms: - deb - rpm - archlinux - dependencies: - - git - recommends: - - golang + dependencies: [] + recommends: [] deb: lintian_overrides: - statically-linked-binary diff --git a/Dockerfile.release b/Dockerfile.release new file mode 100644 index 0000000..eaa74af --- /dev/null +++ b/Dockerfile.release @@ -0,0 +1,8 @@ +# syntax=docker/dockerfile:1 +# See https://hub.docker.com/r/docker/dockerfile + +FROM scratch + +ENTRYPOINT ["/dottie"] + +COPY dottie / diff --git a/README.md b/README.md new file mode 100644 index 0000000..b982331 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Dottie + +TODO diff --git a/Taskfile.yml b/Taskfile.yml index 3547a45..fbd994b 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -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: diff --git a/scripts/completions.sh b/scripts/completions.sh old mode 100644 new mode 100755 index 29008fc..49f92b4 --- a/scripts/completions.sh +++ b/scripts/completions.sh @@ -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 diff --git a/scripts/manpages.sh b/scripts/manpages.sh old mode 100644 new mode 100755