Skip to content
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

ci: new goreleaser workflow #157

Merged
merged 1 commit into from
Jul 21, 2024
Merged
Show file tree
Hide file tree
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
25 changes: 25 additions & 0 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Releaser

on:
push:
tags:
- '*'

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128 changes: 36 additions & 92 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,44 @@
env:
- GO111MODULE=on
- CGO_ENABLED=0
version: 2

before:
hooks:
- go mod tidy
- go mod download

build:
main: main.go
binary: webdav
flags:
- -trimpath
ldflags:
- -s -w -X github.com/hacdias/webdav/cmd.version={{.Version}}
goos:
- darwin
- linux
- windows
- freebsd
- netbsd
- openbsd
goarch:
- amd64
- 386
- arm
- arm64
- mips
- mipsle
- mips64
- mips64le
goarm:
- 5
- 6
- 7
ignore:
- goos: openbsd
goarch: arm
goarm: 6
- goos: freebsd
goarch: arm
goarm: 6
builds:
- main: main.go
binary: webdav
flags:
- '-trimpath'
ldflags:
- '-X github.com/hacdias/webdav/v4/cmd.version={{.Version}}'
goos:
- darwin
- linux
- windows
- freebsd
- netbsd
- openbsd
goarch:
- amd64
- '386'
- arm
- arm64
- mips
- mipsle
- mips64
- mips64le
goarm:
- '5'
- '6'
- '7'
ignore:
- goos: openbsd
goarch: arm
goarm: 6
- goos: freebsd
goarch: arm
goarm: 6

archives:
- name_template: "{{.Os}}-{{.Arch}}{{if .Arm}}v{{.Arm}}{{end}}-{{ .ProjectName }}"
Expand All @@ -54,58 +53,3 @@ release:
name: webdav
draft: false
prerelease: auto

dockers:
- goos: linux
goarch: amd64
goarm: ""
use: buildx
image_templates:
- "hacdias/webdav:amd64-latest"
- "hacdias/webdav:amd64-{{ .Tag }}"
- "hacdias/webdav:amd64-v{{ .Major }}.{{ .Minor }}"
- "hacdias/webdav:amd64-v{{ .Major }}"
- goos: linux
goarch: arm
goarm: 7
use: buildx
build_flag_templates:
- "--platform=linux/arm/v7"
image_templates:
- "hacdias/webdav:armv7-latest"
- "hacdias/webdav:armv7-{{ .Tag }}"
- "hacdias/webdav:armv7-v{{ .Major }}.{{ .Minor }}"
- "hacdias/webdav:armv7-v{{ .Major }}"
- goos: linux
goarch: arm64
goarm: ""
use: buildx
build_flag_templates:
- "--platform=linux/arm64"
image_templates:
- "hacdias/webdav:arm64-latest"
- "hacdias/webdav:arm64-{{ .Tag }}"
- "hacdias/webdav:arm64-v{{ .Major }}.{{ .Minor }}"
- "hacdias/webdav:arm64-v{{ .Major }}"

docker_manifests:
- name_template: hacdias/webdav:latest
image_templates:
- hacdias/webdav:amd64-latest
- hacdias/webdav:armv7-latest
- hacdias/webdav:arm64-latest
- name_template: hacdias/webdav:{{ .Tag }}
image_templates:
- hacdias/webdav:amd64-{{ .Tag }}
- hacdias/webdav:armv7-{{ .Tag }}
- hacdias/webdav:arm64-{{ .Tag }}
- name_template: hacdias/webdav:v{{ .Major }}.{{ .Minor }}
image_templates:
- hacdias/webdav:amd64-v{{ .Major }}.{{ .Minor }}
- hacdias/webdav:armv7-v{{ .Major }}.{{ .Minor }}
- hacdias/webdav:arm64-v{{ .Major }}.{{ .Minor }}
- name_template: hacdias/webdav:v{{ .Major }}
image_templates:
- hacdias/webdav:amd64-v{{ .Major }}
- hacdias/webdav:armv7-v{{ .Major }}
- hacdias/webdav:arm64-v{{ .Major }}