This commit is contained in:
parent
177317d3bd
commit
a6d2bb055a
18
.gitea/workflows/release.yml
Normal file
18
.gitea/workflows/release.yml
Normal file
@ -0,0 +1,18 @@
|
||||
name: Release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: [ubuntu-latest]
|
||||
steps:
|
||||
- uses: actions/setup-go@v3
|
||||
with: { go-version: 1.20 }
|
||||
- run: go install github.com/go-task/task/v3/cmd/task@latest
|
||||
- run: apt update && apt-get install zip
|
||||
- uses: actions/checkout@v3
|
||||
- run: task deps
|
||||
- run: git reset --hard
|
||||
- run: GORELEASER_FORCE_TOKEN=gitea GITEA_TOKEN=${{ secrets.GE_TOKEN }} task release:prod
|
@ -16,6 +16,17 @@ tasks:
|
||||
desc: Install all dependencies (except dredd requirements)
|
||||
cmds:
|
||||
- task: deps:be
|
||||
- task: deps:tools
|
||||
|
||||
deps:tools:
|
||||
desc: Installs tools needed for building
|
||||
vars:
|
||||
GORELEASER_VERSION: "1.19.2"
|
||||
cmds:
|
||||
- '{{ if ne OS "windows" }} sh -c "curl -L https://github.com/goreleaser/goreleaser/releases/download/v{{ .GORELEASER_VERSION }}/goreleaser_$(uname -s)_$(uname -m).tar.gz | tar -xz -C $(go env GOPATH)/bin goreleaser"{{ else }} {{ end }}'
|
||||
- '{{ if ne OS "windows" }} chmod +x $(go env GOPATH)/bin/goreleaser{{ else }} {{ end }}'
|
||||
- '{{ if eq OS "windows" }} echo "NOTICE: You must download goreleaser manually to build this application https://github.com/goreleaser/goreleaser/releases "{{ else }}:{{ end }}'
|
||||
- '{{ if eq OS "windows" }} echo "NOTICE: You need to install golangci-lint manually to build this application https://github.com/golangci/golangci-lint#install"{{ else }}{{ end }}'
|
||||
deps:be:
|
||||
desc: application dependencies
|
||||
cmds:
|
||||
@ -25,3 +36,6 @@ tasks:
|
||||
platforms: [amd64]
|
||||
cmds:
|
||||
- env CGO_ENABLED=0 GOOS={{ .GOOS }} GOARCH={{ .GOARCH }} go build -o ./bin/{{.PROJECT_NAME}}{{ if eq OS "windows" }}.exe{{ end }}
|
||||
release:prod:
|
||||
cmds:
|
||||
- goreleaser
|
Loading…
x
Reference in New Issue
Block a user