ci: add goreleaser to release pipeline (#2343)

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
Richard 2023-05-09 14:58:24 -04:00 committed by GitHub
parent f896b749d3
commit 7d86cfa987
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 10 deletions

View file

@ -1,6 +1,9 @@
on:
release:
types: [published]
push:
branches:
- master
tags:
- /v[0-9]+(\.[0-9]+)*(-.*)*/
name: release
jobs:
@ -9,12 +12,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Get release
id: get_release
uses: bruceadams/get-release@v1.3.2
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Checkout repo
uses: actions/checkout@v3
with:
@ -25,11 +22,17 @@ jobs:
with:
go-version: ^1.15
- name: Install goreleaser
run: go install github.com/goreleaser/goreleaser@latest
- name: Build binaries
run: go run build/build.go
env:
CGO_ENABLED: 0
- name: Goreleaser release
run: goreleaser release
- name: Get release from tag
run: echo ::set-output name=RELEASE_VERSION::$(echo ${GITHUB_REF:11})
id: versioner
@ -40,6 +43,12 @@ jobs:
- name: Copy Linux version to dnscontrol
run: cp dnscontrol-Linux usr/bin/dnscontrol
- name: Get release
id: get_release
uses: bruceadams/get-release@v1.3.2
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Bundle RPM
uses: bpicode/github-action-fpm@master
with:
@ -101,4 +110,3 @@ jobs:
asset_path: dnscontrol_${{ steps.versioner.outputs.RELEASE_VERSION }}_amd64.deb
asset_name: dnscontrol_${{ steps.versioner.outputs.RELEASE_VERSION }}_amd64.deb
asset_content_type: application/vnd.debian.binary-package