Add goreleaser
This commit is contained in:
parent
14aca041ab
commit
4c4e01ddb7
3
.gitignore
vendored
3
.gitignore
vendored
@ -2,4 +2,5 @@
|
|||||||
tmp/*
|
tmp/*
|
||||||
dist/*
|
dist/*
|
||||||
ezshare.toml
|
ezshare.toml
|
||||||
ezshare.test.toml
|
ezshare.test.toml
|
||||||
|
dist/
|
||||||
|
36
.goreleaser.yaml
Normal file
36
.goreleaser.yaml
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# This is an example .goreleaser.yml file with some sensible defaults.
|
||||||
|
# Make sure to check the documentation at https://goreleaser.com
|
||||||
|
before:
|
||||||
|
hooks:
|
||||||
|
# You may remove this if you don't use go modules.
|
||||||
|
- go mod tidy
|
||||||
|
# you may remove this if you don't need go generate
|
||||||
|
- go generate ./...
|
||||||
|
builds:
|
||||||
|
- env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
- windows
|
||||||
|
goarch:
|
||||||
|
- amd64
|
||||||
|
main: ./main.go
|
||||||
|
archives:
|
||||||
|
- format_overrides:
|
||||||
|
- goos: windows
|
||||||
|
format: zip
|
||||||
|
checksum:
|
||||||
|
name_template: 'checksums.txt'
|
||||||
|
snapshot:
|
||||||
|
name_template: "{{ incpatch .Version }}-next"
|
||||||
|
changelog:
|
||||||
|
sort: asc
|
||||||
|
filters:
|
||||||
|
exclude:
|
||||||
|
- '^docs:'
|
||||||
|
- '^test:'
|
||||||
|
gitea_urls:
|
||||||
|
api: https://git.t-juice.club/api/v1/
|
||||||
|
download: https://git.t-juice.club
|
||||||
|
env_files:
|
||||||
|
gitea_token: gitea_token
|
48
.woodpecker.yml
Normal file
48
.woodpecker.yml
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
pipeline:
|
||||||
|
test:
|
||||||
|
image: golang:alpine
|
||||||
|
commands:
|
||||||
|
- go build main.go
|
||||||
|
- go test -v ./...
|
||||||
|
- go vet ./...
|
||||||
|
when:
|
||||||
|
branch: master
|
||||||
|
event: [push, pull_request, tag, deployment]
|
||||||
|
|
||||||
|
image-latest:
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
repo: registry.t-juice.club/peckertest
|
||||||
|
registry: registry.t-juice.club
|
||||||
|
username: woodpecker
|
||||||
|
password:
|
||||||
|
from_secret: registry_password
|
||||||
|
tags:
|
||||||
|
- latest
|
||||||
|
- "${CI_COMMIT_SHA:0:8}"
|
||||||
|
when:
|
||||||
|
branch: master
|
||||||
|
event: push
|
||||||
|
|
||||||
|
image-tagged:
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
repo: registry.t-juice.club/peckertest
|
||||||
|
registry: registry.t-juice.club
|
||||||
|
username: woodpecker
|
||||||
|
password:
|
||||||
|
from_secret: registry_password
|
||||||
|
tags:
|
||||||
|
- "${CI_COMMIT_TAG}"
|
||||||
|
when:
|
||||||
|
event: [tag]
|
||||||
|
|
||||||
|
goreleaser-tagged:
|
||||||
|
image: goreleaser/goreleaser
|
||||||
|
commands:
|
||||||
|
- git fetch --tags
|
||||||
|
- echo "$GITEA_TOKEN" > gitea_token
|
||||||
|
- goreleaser release
|
||||||
|
when:
|
||||||
|
event: [tag]
|
||||||
|
secrets: [gitea_token]
|
@ -1,18 +0,0 @@
|
|||||||
pipeline:
|
|
||||||
tag:
|
|
||||||
image: alpine:latest
|
|
||||||
commands:
|
|
||||||
- cat ezshare/version.go |grep Vers|cut -d "=" -f2 | tr -d " v\""|xargs echo "latest,"|tr -d " " > .tags
|
|
||||||
- cat .tags
|
|
||||||
when:
|
|
||||||
event: [tag]
|
|
||||||
|
|
||||||
publish:
|
|
||||||
image: plugins/docker
|
|
||||||
settings:
|
|
||||||
repo: registry.t-juice.club/ezshare
|
|
||||||
username: woodpecker
|
|
||||||
password:
|
|
||||||
from_secret: registrypass
|
|
||||||
when:
|
|
||||||
event: [tag]
|
|
@ -1,15 +0,0 @@
|
|||||||
pipeline:
|
|
||||||
test:
|
|
||||||
image: golang:${GO_VERSION}
|
|
||||||
commands:
|
|
||||||
- go build main.go
|
|
||||||
- go test -v ./...
|
|
||||||
- go vet ./...
|
|
||||||
when:
|
|
||||||
branch: master
|
|
||||||
event: [push, pull_request, tag, deployment]
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
GO_VERSION:
|
|
||||||
- "1.17"
|
|
||||||
- "latest"
|
|
@ -1,4 +1,4 @@
|
|||||||
package ezshare
|
package ezshare
|
||||||
|
|
||||||
// TODO: Maybe put this somewhere more sensible
|
// TODO: Maybe put this somewhere more sensible
|
||||||
const Version = "v0.1.9"
|
const Version = "v0.1.10"
|
||||||
|
Loading…
Reference in New Issue
Block a user