mirror of
https://github.com/apricote/hcloud-upload-image.git
synced 2026-01-13 21:31:03 +00:00
Use `goreleaser` and `ko` to automatically build and publish container images in the release workflow. The images are published to `ghcr.io/apricote/hcloud-upload-image`. Co-authored-by: Ilja Malachowski <malahovskiy.in@gmail.com>
130 lines
3.7 KiB
YAML
130 lines
3.7 KiB
YAML
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
|
|
|
|
version: 2
|
|
|
|
before:
|
|
hooks:
|
|
- ./scripts/completions.sh
|
|
|
|
builds:
|
|
- id: default
|
|
env:
|
|
- CGO_ENABLED=0
|
|
goos:
|
|
- linux
|
|
- windows
|
|
- darwin
|
|
mod_timestamp: "{{ .CommitTimestamp }}"
|
|
flags:
|
|
- -trimpath
|
|
ldflags:
|
|
- -X {{ .ModulePath }}/internal/version.version={{ .Version }}
|
|
- -X {{ .ModulePath }}/internal/version.versionPrerelease=
|
|
|
|
archives:
|
|
- formats: [ "tar.gz" ]
|
|
# this name template makes the OS and Arch compatible with the results of `uname`.
|
|
name_template: >-
|
|
{{ .ProjectName }}_
|
|
{{- title .Os }}_
|
|
{{- if eq .Arch "amd64" }}x86_64
|
|
{{- else if eq .Arch "386" }}i386
|
|
{{- else }}{{ .Arch }}{{ end }}
|
|
{{- if .Arm }}v{{ .Arm }}{{ end }}
|
|
# use zip for windows archives
|
|
format_overrides:
|
|
- goos: windows
|
|
formats: [ "zip" ]
|
|
|
|
files:
|
|
- README.md
|
|
- LICENSE
|
|
- completions/*
|
|
|
|
nfpms:
|
|
- id: default
|
|
file_name_template: "{{ .ConventionalFileName }}"
|
|
package_name: hcloud-upload-image
|
|
vendor: Julian Tölle
|
|
homepage: https://github.com/apricote/hcloud-upload-image
|
|
maintainer: Julian Tölle <julian.toelle97@gmail.com>
|
|
formats:
|
|
- deb
|
|
- rpm
|
|
- apk
|
|
description: Manage custom OS images on Hetzner Cloud.
|
|
license: MIT
|
|
dependencies:
|
|
- openssh
|
|
recommends:
|
|
- hcloud-cli
|
|
|
|
contents:
|
|
- src: ./completions/hcloud-upload-image.bash
|
|
dst: /usr/share/bash-completion/completions/hcloud-upload-image
|
|
file_info:
|
|
mode: 0644
|
|
- src: ./completions/hcloud-upload-image.fish
|
|
dst: /usr/share/fish/vendor_completions.d/hcloud-upload-image.fish
|
|
file_info:
|
|
mode: 0644
|
|
- src: ./completions/hcloud-upload-image.zsh
|
|
dst: /usr/share/zsh/vendor-completions/_hcloud-upload-image
|
|
file_info:
|
|
mode: 0644
|
|
- src: ./LICENSE
|
|
dst: /usr/share/doc/hcloud-upload-image/license
|
|
file_info:
|
|
mode: 0644
|
|
|
|
|
|
aurs:
|
|
- name: hcloud-upload-image-bin
|
|
homepage: "https://github.com/apricote/hcloud-upload-image"
|
|
description: Manage custom OS images on Hetzner Cloud.
|
|
maintainers:
|
|
- "Julian Tölle <julian.toelle97@gmail.com>"
|
|
license: MIT
|
|
private_key: "{{ .Env.AUR_SSH_KEY }}"
|
|
git_url: "ssh://aur@aur.archlinux.org/hcloud-upload-image-bin.git"
|
|
depends:
|
|
- openssh
|
|
|
|
package: |-
|
|
# bin
|
|
install -Dm755 "./hcloud-upload-image" "${pkgdir}/usr/bin/hcloud-upload-image"
|
|
|
|
# license
|
|
install -Dm644 "./LICENSE" "${pkgdir}/usr/share/licenses/hcloud-upload-image/LICENSE"
|
|
|
|
# completions
|
|
mkdir -p "${pkgdir}/usr/share/bash-completion/completions/"
|
|
mkdir -p "${pkgdir}/usr/share/zsh/site-functions/"
|
|
mkdir -p "${pkgdir}/usr/share/fish/vendor_completions.d/"
|
|
install -Dm644 "./completions/hcloud-upload-image.bash" "${pkgdir}/usr/share/bash-completion/completions/hcloud-upload-image"
|
|
install -Dm644 "./completions/hcloud-upload-image.zsh" "${pkgdir}/usr/share/zsh/site-functions/_hcloud-upload-image"
|
|
install -Dm644 "./completions/hcloud-upload-image.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/hcloud-upload-image.fish"
|
|
|
|
kos:
|
|
- id: container-images
|
|
build: default
|
|
repositories:
|
|
- ghcr.io/apricote
|
|
platforms:
|
|
- linux/amd64
|
|
- linux/arm64
|
|
base_import_paths: true
|
|
labels:
|
|
org.opencontainers.image.source: https://github.com/apricote/hcloud-upload-image
|
|
tags:
|
|
- latest
|
|
- "{{.Tag}}"
|
|
|
|
snapshot:
|
|
version_template: "{{ .Version }}-dev+{{ .ShortCommit }}"
|
|
|
|
changelog:
|
|
# Generated by release-please
|
|
disable: true
|
|
|
|
|