feat: auto-release abra with goreleaser when a tag is pushed #73

Merged
decentral1se merged 1 commits from knoflook/abra:main into main 2021-09-07 05:15:16 +00:00
3 changed files with 67 additions and 4 deletions

View File

@ -42,6 +42,31 @@ steps:
when:
status:
- failure
trigger:
branch:
- main
- name: fetch
image: docker:git
commands:
- git fetch --tags
depends_on:
- make check
decentral1se marked this conversation as resolved Outdated

When a successful build runs, the notify on failure doesn't run because there was no failure.

So, fetch and release will be skipped then. I think you need to do:

depends_on:
- make check
- make build
- make test

You're also missing this?

when:
  event: tag
When a successful build runs, the `notify on failure` doesn't run because there was no failure. So, `fetch` and `release` will be skipped then. I think you need to do: ```yaml depends_on: - make check - make build - make test ``` You're also missing this? ```yaml when: event: tag ```
- make build
- make test
decentral1se marked this conversation as resolved Outdated

Can we pin to 1.16 to use the same as development? Using just golang here means latest which might give us inconsistencies somewhere down the line.

Can we pin to `1.16` to use the same as development? Using just `golang` here means `latest` which might give us inconsistencies somewhere down the line.
- name: release
image: golang:1.16
environment:
GITEA_TOKEN:
from_secret: gitea_token
volumes:
- name: deps
path: /go
commands:
- curl -sL https://git.io/goreleaser | bash
depends_on:
- fetch
when:
event: tag
volumes:
- name: deps
temp: {}

3
.gitignore vendored
View File

@ -1,4 +1,5 @@
abra
.vscode/
vendor/
.envrc
.envrc
dist/

37
.goreleaser.yml Normal file
View File

@ -0,0 +1,37 @@
# This is an example .goreleaser.yml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
gitea_urls:
api: https://git.coopcloud.tech/api/v1
download: https://git.coopcloud.tech/
skip_tls_verify: false
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
dir: cmd/abra
goos:
- linux
# - windows
# - darwin
archives:
- replacements:
linux: Linux
# darwin: Darwin
# windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'