Skip to content

Commit

Permalink
ci: add goreleaser to release pipeline (#2343)
Browse files Browse the repository at this point in the history
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
SignalRichard and tlimoncelli authored May 9, 2023
1 parent f896b74 commit 7d86cfa
Showing 2 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -118,7 +118,7 @@ jobs:
GCLOUD_PRIVATEKEY: ${{ secrets.GCLOUD_PRIVATEKEY }}
GCLOUD_PROJECT: ${{ secrets.GCLOUD_PROJECT }}
GCLOUD_TYPE: ${{ secrets.GCLOUD_TYPE }}

HEDNS_PASSWORD: ${{ secrets.HEDNS_PASSWORD }}
HEDNS_TOTP_SECRET: ${{ secrets.HEDNS_TOTP_SECRET }}
HEDNS_USERNAME: ${{ secrets.HEDNS_USERNAME }}
26 changes: 17 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7d86cfa

Please sign in to comment.